摘要:
1.声明委托:委托是方法的签名,定义格式类似声明函数,如:public delegate string TestDelegate(string message);2.实例化委托:实例化时,可以关联具有兼容签名的任何方法();TestDelegate handler = DelegateMethod;// 被关联的委托函数string DelegateMethod(string message){ ... 阅读全文
摘要:
1.声明委托:委托是方法的签名,定义格式类似声明函数,如:public delegate string TestDelegate(string message);2.实例化委托:实例化时,可以关联具有兼容签名的任何方法();TestDelegate handler = DelegateMethod;// 被关联的委托函数string DelegateMethod(string message){ ... 阅读全文
|