委托与委托关键字 [英] Delegate vs. delegate keyword

查看:329
本文介绍了委托与委托关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您想创建自定义委托,您将使用小写的委托关键字。

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 the Delegate class or from the MulticastDelegate class. It is also not permissible to derive a new type from a delegate type. The Delegate 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆