Example of subscribing to and firing events


/ Published in: C#
Save to your folder(s)

See [Raise and Handle Events Generically](http://snipplr.com/view/15033/raise-and-handle-events-generically/) for a better way to use events (generically) and links to best practices in .NET events.

This example should be used as a Console program and will simply write a line of text to the console. It shows how to create an event handler in a class, have that event handler fire an event with custom information, and how to subscribe to that event and use its data. I hope it is straightforward enough.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.