委托与委托关键字 [英] Delegate vs. delegate keyword
问题描述
如果您想创建自定义委托,您将使用小写的委托关键字。
If you like to create custom delegates you would use the delegate keyword in lowercase.
您可以使用实际的代表类做什么?这有什么好处?不了解确切的区别。
What can you do with the actual Delegate Class? What is this good for? Don't understand the exact difference.
推荐答案
从 http://msdn.microsoft.com/en-us/library/system.delegate.aspx :
代理类型为
的基类
代表类型为code。但是,只有
系统和编译器可以从Delegate
类中明确导出
或
从$ $ c $ MulticastDelegate class。它
也不允许从委托类型派生一个
新的类型。
委托
类不被认为是
委托类型;它是一个用于
派生类型的类。
The
Delegate
class is the base class for delegate types. However, only the system and compilers can derive explicitly from theDelegate
class or from theMulticastDelegate
class. It is also not permissible to derive a new type from a delegate type. TheDelegate
class is not considered a delegate type; it is a class used to derive delegate types.
大多数语言实现一个委托
关键字和这些
语言的编译器能够从
MulticastDelegate
类派生;因此,
用户应使用该语言提供的委托
关键字
。
Most languages implement a delegate
keyword, and compilers for those
languages are able to derive from the
MulticastDelegate
class; therefore,
users should use the delegate
keyword
provided by the language.
这篇关于委托与委托关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!