private static void DisposeAll(IEnumerable enumerable) { foreach (object o in enumerable) if (o is IDisposable) ((IDisposable)o).Dispose(); }