using System; using System.Linq; using System.Collections.Generic; using System.Globalization; using System.Net; public class Test { public static void Main() { bool IsDisposable = typeof(IDisposable).IsAssignableFrom(typeof(System.IO.TextWriter)); Console.WriteLine("Is TextWriter disposable? " + IsDisposable); } }