[9-5]委托的使用

1.委托的声明

 delegate void DGMethod(string str)

2.创建委托,添加方法指针

DGMethod method = new DGMethod(getString)

也可以使用简单创建 DGMethod method = getString

3.调用委托

method(str)

 

Action<T> 无返回类型

Func<T> 可有返回值

Func<double,double>[] operations ={ ,}

posted @ 2014-09-05 16:58  Bparadise  阅读(66)  评论(0)    收藏  举报