gpt4 book ai didi

.net - 委托(delegate)与委托(delegate)关键字

转载 作者:行者123 更新时间:2023-12-03 07:37:32 24 4
gpt4 key购买 nike

如果您想创建自定义委托(delegate),您可以使用小写的 delegate 关键字。

你可以用实际的Delegate类做什么?这有什么用?我不明白确切的区别。

最佳答案

来自http://msdn.microsoft.com/en-us/library/system.delegate.aspx :

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.

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.

关于.net - 委托(delegate)与委托(delegate)关键字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/779021/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com