cleol
[mcs.git] / tests / test-iter-11.cs
blob3dcce679f4aaeb56fea79a7e13c6025a73d23cae
1 using System;
2 using System.Collections;
4 class X {
5 public event EventHandler Hook;
7 public IEnumerator Pipeline ()
9 if (Hook == null)
10 throw new Exception ("error");
12 Hook (this, EventArgs.Empty);
14 yield return 0;
17 static void M (object sender, EventArgs args)
19 Console.WriteLine ("Hook invoked");
22 static void Main ()
24 X x = new X ();
25 x.Hook += M;
26 IEnumerator y = x.Pipeline ();
27 y.MoveNext ();