Class with 2 events public class Worker { // Created 2 events public event EventHandler OnCompleted; public event EventHandler<WorkerArgs> InBetween; public void DoWork(int age, string address) { for (int i = 0; i < age - 1; i++) { Thread.Sleep(1000); // Either this way //var del= InBetween as EventHandler<WorkerArgs>; //if (del != null) del(this,new WorkerArgs(i,address)); // Or Directly ...
I jot down whatever I learn from different sources.Written for personal use. But anyone can learn.