Esempio n. 1
0
        public static void OnDispose(this IDisposablePattern disposablePattern)
        {
            foreach (var disposeAction in disposablePattern.DisposeActions)
            {
                disposeAction();
            }

            disposablePattern.DisposeActions.Clear();

            disposablePattern.DisposeNativeResources();
        }
Esempio n. 2
0
 // NOTE: Leave out the finalizer altogether if this class doesn't
 // own unmanaged resources, but leave the other methods
 // exactly as they are.
 public static void OnDestruct(this IDisposablePattern disposablePattern)
 {
     // Finalizer calls Dispose(false)
     disposablePattern.DisposeNativeResources();
 }