// Generic delegates. using System; delegate void Test (T t); class Foo { public event Test MyEvent; public void Hello (T t) { if (MyEvent != null) MyEvent (t); } } class X { static void do_hello (string hello) { Console.WriteLine ("Hello: {0}", hello); } public static void Main () { Foo foo = new Foo (); foo.MyEvent += new Test (do_hello); foo.Hello ("Boston"); } }