using System;
using System.Collections.Generic;
using System.Text;
class Program {
staticvoid Main(string[] args) {
using (MyResourceWrapper rw = new MyResourceWrapper()) {
}
MyResourceWrapper rw2 = new MyResourceWrapper();
for (int i = 0; i < 10; i++)
rw2.Dispose();
}
}
publicclass MyResourceWrapper : IDisposable {
publicvoid Dispose() {
Console.WriteLine("In Dispose() method!");
}
}