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

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

问题描述

如果你想创建自定义的代表,你会使用小写委托关键字。

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.

推荐答案

从<一个href="http://msdn.microsoft.com/en-us/library/system.delegate.aspx">http://msdn.microsoft.com/en-us/library/system.delegate.aspx:

代理类的基类   对于委托类型。然而,只有   系统和编译器可以得到   明确从代理类或   从 MulticastDelegate 类。它   也不允许以导出   新型的委托类型。该   代理类不被认为是   委托类型;它是用一类   派生委托类型。

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天全站免登陆