using System;
/*
An Event is created using event keyword.
An Event has no return type and it is always void.
All events are based on delegates.
All the published events must have a listening object.
All Events should be defined starting with “On” keyword.
Delegates are used to reference a method. An Event is associated with Event Handler using Delegates.
// When an Event raise, it sends a signal to delegates and delegates executes the right function.
There are two parts in any event handling program.
One part is Publisher that contains definition of events and delegates.
and another part is Subscriber that accepts the event and provides an event handler.
*/
public class Program
{ public delegate void MyDelegate();
public static event MyDelegate MyEvent;
public static void Main()
{
MyEvent += delegate {Console.WriteLine("dat is de event ");};
MyEvent();
}