internal static void EnsureNotDisposed( this SDX.DisposeBase disposeBase, string checkedVariableName, [CallerMemberName] string callerMethod = "") { if (string.IsNullOrEmpty(callerMethod)) { callerMethod = "Unknown"; } if (disposeBase.IsDisposed) { throw new SeeingSharpCheckException(string.Format( "Resource {0} within method {1} musst not be disposed!", checkedVariableName, callerMethod)); } }
void SafeDispose(DisposeBase disposableObj) { if (disposableObj != null) disposableObj.Dispose(); }
public static void SafeDispose(DisposeBase disposable) { if (disposable != null && !disposable.IsDisposed) { disposable.Dispose(); } }