摘要:
用字典存储系列委托http://stackoverflow.com/questions/3813261/how-to-store-delegates-in-a-list1.System.Collections.Generic.Dictionary ;2.dic.Add("action", new Action(() => Console.WriteLine("action called!")));3. Dictionary> fnDict = new Dictionary>(); Func fn = (a) => a + 1; f 阅读全文
摘要:
http://msdn.microsoft.com/zh-cn/library/w369ty8x(v=vs.90).aspx如果没有自定义 EventArgs 类,事件类型就是非泛型 EventHandler 委托。它无需声明,因为它已在创建 C# 项目时包含的 System 命名空间中进行了声明:例如public event EventHandler RaiseCustomEvent;namespace DotNetEvents{ using System; using System.Collections.Generic; // Define a class to hold custom 阅读全文