* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / tests / test-iter-11.cs
1 using System;
2 using System.Collections;
3
4 class X {
5         public event EventHandler Hook;
6
7         public IEnumerator Pipeline ()
8         {
9                 if (Hook == null)
10                         throw new Exception ("error");
11
12                 Hook (this, EventArgs.Empty);
13                 
14                 yield return 0;
15         }
16
17         static void M (object sender, EventArgs args)
18         {
19                 Console.WriteLine ("Hook invoked");
20         }
21         
22         static void Main ()
23         {
24                 X x = new X ();
25                 x.Hook += M;
26                 IEnumerator y = x.Pipeline ();
27                 y.MoveNext ();
28         }
29 }
30