使用代表有什么好处? [英] What is the advantages of using delegates ?

查看:95
本文介绍了使用代表有什么好处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

其实我不知道什么是代表,以及在哪里使用代表?



这个小组中的任何一个人都可以告诉我有关代表的情况以及委托代表的情况使用?

Actually i don't no what is delegates, and where to use delegates ?

could any one in this group tell me about delegates and at what situation delegates to be used ?

推荐答案

如果你对代表一无所知,为什么不读一下呢?



从这里开始:

代表(C#编程指南) [ ^ ]

代表教程 [ ^ ]
If you know nothing about delegates, why don't you read about that?

Start here:
Delegates (C# Programming Guide)[^]
Delegates Tutorial[^]


1)通常,委托允许您定义方法签名,然后通过属性或方法参数使用它们。这可以用于不同类之间的通信;



有关详细信息,请参阅下一篇文章:代表和事件的6个重要用途 [ ^ ]



2)最常见的用途.NET中的代理用于定义事件和事件处理程序;

事件教程 [ ^ ]
1)In general the delegate let you defines methods signatures and then to use them via properties or methods parameters. This could be use in communication between different classes;

For details about this see the next article: 6 important uses of Delegates and Events[^]

2)The most common use of the delegates in .NET are for defining events and events handlers;
Event Tutorials[^]


这篇关于使用代表有什么好处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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