访问修饰符 [英] Access Modifiers
本文介绍了访问修饰符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试整理一个包含xaml和C#文件的dll.
因此,我只想向用户公开一些命令.
我正在使用声明为public
的ICommand接口.这意味着我必须公开ICommand实现.
有人可以帮我隐瞒ICommand的实现吗??
实际上,是接口是内部
还是public
,还是应该有两个接口声明,其中一个是内部
和?另一个public
?
问候,
Igal
Hi,
I am trying to finilize a dll which incorporates xaml and C# files.
Thus I''d like to exposes only a few commands to the user.
I am using the ICommand interface which is declared as public
. This means that I have to expose the ICommand implementation.
Can someone help me to conceal the ICommand implementation???
Actually it is a philosophical question whether interfaces are internal
or public
, or should there be two declarations of interfaces one internal
and the other public
?
Regards,
Igal
推荐答案
好.只是一个例子,不说话.
Ok. Just an example, no talking.
internal class A
{
// Must match definition in parent class (Object)
public override string ToString()
{
return "A";
}
}
这篇关于访问修饰符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文