2 using System.Collections.Generic;
4 class MyDisposable : IDisposable
16 public override string ToString ()
18 return String.Format ("{0} ({1})", GetType (), id);
24 public static IEnumerable<int> Test (int a)
27 using (d = new MyDisposable ()) {
35 foreach (int a in Test (5))
36 Console.WriteLine (a);