示例#1
0
 /// <summary>
 /// Calls <see cref="IDisposable.Dispose"/> on an <see cref="IDisposable"/> object when not null.
 /// </summary>
 /// <param name="disposable"></param>
 public static void SafeDispose(this IDisposable disposable)
 {
     disposable.DoWhen(d => d.Dispose());
 }