Action<T> Delegate 使用
来源:互联网 发布:c foreach 遍历数组 编辑:程序博客网 时间:2024/06/05 18:21
1. new Action(()=>{})
2. (Action)(()=>{})
3.
public void show(){Action<String> messageAction;messageAction=ShowMessage;messageAction("HelloWorld!");}private void showMessage(String message){Console.WriteLine(message);}
4.
public void show(){Action<String> messageAction;messageAction=delegate (String s){ShowMessage(s)};messageAction("HelloWorld!");}private void showMessage(String message){Console.WriteLine(message);}
So we can treat Action as a method delegate with one parameter and no return value.
when declare an event, we can use like:
public event Action<String> messageArriveEvent;
messageArrive+=new Action(()=>{});
0 0
- Action<T> Delegate 使用
- C# Action<T> 使用
- Func<> Delegate和Action<> Delegate
- Delegate,Action,Func,Predicate的使用与区别
- Delegate,Action,Func,Predicate的使用与区别
- Delegate,Action,Func,Predicate的使用与区别
- Delegate,Action,Func,Predicate的使用与区别
- action outlet 委托delegate
- Delegate,Action Sheet, Alert
- delegate / target, action / block
- C# 委托 delegate Action
- t:jscookMenu t:panelNavigation2 及 t:jscookMenu不能够使用action跳转
- Delegate,Action,Func的应用
- .net Delegate ,Func ,Action 委托
- Delegate、Predicate、Action和Func
- IOS--UI--LessonTarget/Action /Delegate
- delegate 使用
- Unity C#中Delegate,Action,Func,Predicate的使用与区别
- 认识(大端--小端)端模式
- 关于Android的多种屏幕适配
- openstack 命令行管理一 - br-ex 网络设定 (备忘)
- int转换成指定位数string,不足位数前面补0
- LVS原理详解
- Action<T> Delegate 使用
- 教你如何快速成为一个SEOer
- C# 多线程多参数和返回值用法
- 经典问题总结(一)
- .Net开发工程师面试题
- CocoaChina 论坛源码推荐 持续更新中。。。
- linux shell awk 语法
- C51单片机 波特率选择 和 串口的工作方式
- 内存分析工具 MAT 的使用