Class Disposable
Implements the System.IDisposable and System.IAsyncDisposable interfaces.
Inheritance
System.Object
Disposable
Namespace: Solti.Utils.Primitives.Patterns
Assembly: Solti.Utils.Primitives.dll
Syntax
public class Disposable : Object, IDisposableEx
Constructors
Disposable(Boolean)
Creates a new Disposable instance.
Declaration
public Disposable(bool supportFinalizer = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | supportFinalizer |
Properties
Disposed
Indicates whether the object was disposed or not.
Declaration
public bool Disposed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Disposing
Indicates whether the object disposal logic has already been invoked or not.
Declaration
public bool Disposing { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AsyncDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting resources asynchronously
Declaration
protected virtual ValueTask AsyncDispose()
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask |
CheckNotDisposed()
Throws if the current instance has already been disposed.
Declaration
protected void CheckNotDisposed()
Dispose()
Implements the System.IDisposable.Dispose method.
Declaration
public void Dispose()
Dispose(Boolean)
Method to be overridden to implement custom disposal logic.
Declaration
protected virtual void Dispose(bool disposeManaged)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposeManaged | It is set to true on System.IDisposable.Dispose call. |
DisposeAsync()
Implements the System.IAsyncDisposable.DisposeAsync method.
Declaration
public ValueTask DisposeAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask |
Implements
System.IDisposable
System.IAsyncDisposable