{#advanced_dlg.about_title}

»

Sunday, March 14, 2010 | 0 Comments

The eventing mechanism built into the .NET runtime makes it a piece of cake to implement a simple publisher - subscriber pattern (C# code follows). The example below revolves around the ‘payday’ event – which is called PayrollArrived. The event is published by the Employer class (the Employer announces when payday arrives). Each Employee (i.e. each instance of the Employee class) listens for the event – and is hence a subscriber to the PayrollArrived event. // Publisher Class – EmployerPublishe... [More]