Show / Hide Table of Contents

Class DisposableBase

IDisposable implementation base class.

Inheritance
System.Object
DisposableBase
DisposableBindableBase
Implements
System.IDisposable
Namespace: MAT.Atlas.Api.Core.System
Assembly: MAT.Atlas.Api.Core.dll
Syntax
public abstract class DisposableBase : Object, IDisposable
Remarks

The class abstracts and implements the disposable pattern as recommended by Microsoft. The abstraction provides two methods:

On rare occasions you may need finer control and you have the option to override Dispose(Boolean).

Constructors

DisposableBase()

Declaration
protected DisposableBase()

Properties

IsDisposed

Whether object has already been disposed.

Declaration
protected bool IsDisposed { get; }
Property Value
Type Description
System.Boolean

Methods

Dispose()

Dispose.

Declaration
public void Dispose()

Dispose(Boolean)

Called by Dispose() or finalization. This method calls, in the following order:

Declaration
protected virtual void Dispose(bool isDisposing)
Parameters
Type Name Description
System.Boolean isDisposing

Has Dispose been called.

Remarks

Override this method for fine grained control but it should rarely be needed. Instead just implement OnDisposeManagedResources() and potentially override OnDisposeUnmanagedResources(). A use case where you might override this method is to alter the order in which resources are disposed.

Finalize()

Finalization.

Declaration
protected override void Finalize()

OnDisposeManagedResources()

Called to free managed resources.

Declaration
protected abstract void OnDisposeManagedResources()

OnDisposeUnmanagedResources()

Called to free unmanaged resources (optional).

Declaration
protected virtual void OnDisposeUnmanagedResources()

Implements

System.IDisposable
In This Article
Back to top Generated by DocFX