Provides implementation of dispose pattern.
Namespace: DotNext Assembly: DotNext.dll Syntaxpublic abstract class Disposable : IDisposable
Properties | Edit this page View Source DisposedTask
Gets a task representing ObjectDisposedException exception.
Declarationprotected Task DisposedTask { get; }
Property Value | Edit this page View Source IsDisposed
Indicates that this object is disposed.
Declarationprotected bool IsDisposed { get; }
Property Value | Edit this page View Source IsDisposing
Indicates that DisposeAsync() is called but not yet completed.
Declarationprotected bool IsDisposing { get; }
Property Value | Edit this page View Source IsDisposingOrDisposed
Indicates that DisposeAsync() is called.
Declarationprotected bool IsDisposingOrDisposed { get; }
Property Value Methods | Edit this page View Source CreateException()
Creates a new instance of ObjectDisposedException class.
Declarationprotected ObjectDisposedException CreateException()
Returns | Edit this page View Source Dispose()
Releases all resources associated with this object.
Declaration | Edit this page View Source Dispose(bool)Releases managed and unmanaged resources associated with this object.
Declarationprotected virtual void Dispose(bool disposing)
Parameters | Edit this page View Source Dispose(IEnumerable<IDisposable?>)
Disposes many objects.
Declarationpublic static void Dispose(IEnumerable<IDisposable?> objects)
Parameters | Edit this page View Source DisposeAsync()
Releases managed resources associated with this object asynchronously.
Declarationprotected ValueTask DisposeAsync()
Returns Type Description ValueTask
The task representing asynchronous execution of this method.
| Edit this page View Source DisposeAsync(IEnumerable<IAsyncDisposable?>)Disposes many objects.
Declarationpublic static ValueTask DisposeAsync(IEnumerable<IAsyncDisposable?> objects)
Parameters Returns Type Description ValueTask
The task representing asynchronous execution of this method.
| Edit this page View Source DisposeAsync(params IAsyncDisposable?[])Disposes many objects in safe manner.
Declarationpublic static ValueTask DisposeAsync(params IAsyncDisposable?[] objects)
Parameters Type Name Description IAsyncDisposable[] objects
An array of objects to dispose.
Returns Type Description ValueTaskThe task representing asynchronous execution of this method.
| Edit this page View Source DisposeAsyncCore()Releases managed resources associated with this object asynchronously.
Declarationprotected virtual ValueTask DisposeAsyncCore()
Returns Type Description ValueTask
The task representing asynchronous execution of this method.
| Edit this page View Source Dispose<T>(ReadOnlySpan<T>)Disposes many objects in safe manner.
Declarationpublic static void Dispose<T>(ReadOnlySpan<T> objects) where T : IDisposable?
Parameters Type Name Description ReadOnlySpan<T> objects
An array of objects to dispose.
Type Parameters | Edit this page View Source ~Disposable()Finalizes this object.
Declaration | Edit this page View Source GetDisposedTask<T>()Returns a task representing ObjectDisposedException exception.
Declarationprotected Task<T> GetDisposedTask<T>()
Returns Type Parameters Name Description T
The type of the task.
| Edit this page View Source TryBeginDispose()Starts disposing this object.
Declarationprotected bool TryBeginDispose()
Returns Type Description bool
true if cleanup operations can be performed; false if the object is already disposing.
| Edit this page View Source TrySetDisposedException(TaskCompletionSource)Attempts to complete the task with ObjectDisposedException exception.
Declarationprotected bool TrySetDisposedException(TaskCompletionSource source)
Parameters Returns Type Description bool
true if operation was successful; otherwise, false.
| Edit this page View Source TrySetDisposedException<T>(TaskCompletionSource<T>)Attempts to complete the task with ObjectDisposedException exception.
Declarationprotected bool TrySetDisposedException<T>(TaskCompletionSource<T> source)
Parameters Returns Type Description bool
true if operation was successful; otherwise, false.
Type Parameters Name Description TThe type of the task.
Implements Extension Methods See AlsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4