using System;
using System.Collections.Generic;
using System.Text;
publicclass MyResourceWrapper : IDisposable {
publicvoid Dispose() {
Console.WriteLine("In Dispose() method!");
}
}
class Program {
staticvoid Main(string[] args) {
MyResourceWrapper rw = new MyResourceWrapper();
if (rw is IDisposable)
rw.Dispose();
using (MyResourceWrapper rw2 = new MyResourceWrapper()) {
}
}
}