public void _4_EventExample() { var importantProcess = new ImportantProcess(); // Register a couple of handlers, both with lambdas and methods. // Multiple different objects, potentially in different threads could register for the events importantProcess.PercentageComplete += x => Console.WriteLine("Done " + x + " percent"); importantProcess.PercentageComplete += ProgressUpdated; importantProcess.Go(); }
public void _4_EventExample() { var importantProcess = new ImportantProcess(); // Register a couple of handlers, both with lambdas and methods. Multiple different // objects, potentially in different threads could register for the events importantProcess.PercentageComplete += x => Console.WriteLine("Done " + x + " percent"); importantProcess.PercentageComplete += ProgressUpdated; importantProcess.Go(); }