为什么Microsoft引入委托和匿名方法?

问题描述:

为什么Microsoft会引入委托和匿名方法?



是否(委托)执行c#中的任何其他内容?



如何实时使用代理?

Why Microsoft introduce Delegate and Anonymous Methods?

Is it(Delegate) implementation of any other thing in c#?

How delegates are used in real time?

你没有阅读文档,是吗?



来自MSDN上的委托(C#参考)[ ^ ]:

You did not read the documentation, did you?

From "delegate (C# Reference)" at MSDN[^]:
委托是一种可用于封装命名或匿名方法的引用类型。委托类似于C ++中的函数指针;但是,代表们是类型安全且安全的。对于代理人的申请,请参阅代表和通用代表。
A delegate is a reference type that can be used to encapsulate a named or an anonymous method. Delegates are similar to function pointers in C++; however, delegates are type-safe and secure. For applications of delegates, see Delegates and Generic Delegates.



以同样的方式,您可以找到关于 MSDN 的 MSDN 文档。 a href =http://msdn.microsoft.com/en-us/library/0yw3tz5k.aspx>匿名方法 [ ^ ]。


In the same way you may find pretty informative the MSDN documentation on "Anonymous Methods"[^].