Wednesday, August 5, 2009

How to Write a your own EventHander to a Class

This is example shows how you can write an own event to your class. I tried several methods and ways to do this even though this includes some basic logic behind.

We are going to write Car class which raise, invoke or fire an event when 2 drivers are getting in to the car.


 

Following shows our interface to add drivers to the car.


The following code describes how to handle the event. Code shows how to display message when two drivers are added to the car.

 

Post a Comment