2009-03-11 Zoltan Varga <vargaz@gmail.com>
[mcs.git] / tests / gtest-046.cs
blob40f01434d901503813554adceedcebc39d3d2cc4
1 // Generic delegates.
3 using System;
5 delegate void Test<T> (T t);
7 class Foo<T>
9 public event Test<T> MyEvent;
11 public void Hello (T t)
13 if (MyEvent != null)
14 MyEvent (t);
18 class X
20 static void do_hello (string hello)
22 Console.WriteLine ("Hello: {0}", hello);
25 static void Main ()
27 Foo<string> foo = new Foo<string> ();
28 foo.MyEvent += new Test<string> (do_hello);
29 foo.Hello ("Boston");