using System; namespace EventExample { class ClassWithEvent { public event EventHandler MyEvent; public void DoSomeWork() { //some code here MyEvent.Invoke(this, new EventArgs()); } } class Program { static void Main(string[] args) { ClassWithEvent c = new ClassWithEvent(); EventHandler myPE = delegate(object source, EventArgs e) { Console.WriteLine("Processing MyEvent."); }; c.MyEvent += myPE; c.DoSomeWork(); Console.ReadLine(); } } }