Anonymous delegates and event execution

A nice little trick to save you always checking for null when firing custom events
Initialize to anonymous delegate.
Ok.. we've an extra call in the invocation list so use judiciously

[code:c#]

public event CompleteTaskExecutionHandler CompleteExecution = delegate { };

//or a sample using Lambdas

public event PropertyChangedEventHandler PropertyChanged = (s,p) => { };

 

 

private void Fire()
{
   this.CompleteExecution(...);
}

 

[/code]

Recent Tweets

Note: For Customization and Configuration, CheckOut Recent Tweets Documentation

Calendar

<<  May 2017  >>
MoTuWeThFrSaSu
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

Month List