01/03/10
事无正邪,人无优劣,当位则正,非位则邪。
Delegate , Event in 2.0
- Define custom eventargs first if necessary
- Define delegate
- public delegate void MathMessage(string msg,int result);
- Define event with new created delegate () (so event is a special delegate with two special parameters (sender, eventargs)
- public event MathMessage ComputationFinished;
- Define methods (can define anonymous method)
- Register methods with event (event+=method name , new way)
Lambda Expression
((argument list)=> {;});
0 Comments:
Post a Comment
<< Home