public static void InTheBeginning() { Worker peter = new Worker(); Boss boss = new Boss(); peter.completed += new WorkCompleted(boss.WorkCompleted); peter.started += new WorkStarted(Universe.WorkerStartedWork); peter.completed += new WorkCompleted(Universe.WorkerCompletedWork); peter.DoWork(); Console.WriteLine("From Universe Beginning: worker completed work"); }
static void Main() { Worker peter = new Worker(); Boss boss = new Boss(); peter.completed += new WorkCompleted(boss.WorkCompleted); peter.started += new WorkStarted(Universe.WorkerStartedWork); peter.completed += new WorkCompleted(Universe.WorkerCompletedWork); peter.DoWork(); Console.WriteLine("Main: worker completed work"); Console.ReadLine(); }