Nito.Disposables
A disposable that executes a delegate when disposed.
Creates a new disposable that executes when disposed.
The delegate to execute when disposed. If this is null, then this instance does nothing when it is disposed.
Adds a delegate to be executed when this instance is disposed. If this instance is already disposed or disposing, then is executed immediately.
The delegate to add. May be null to indicate no additional action.
Creates a new disposable that executes when disposed.
The delegate to execute when disposed. May not be null.
Disposes a collection of disposables.
Creates a disposable that disposes a collection of disposables.
The disposables to dispose.
Creates a disposable that disposes a collection of disposables.
The disposables to dispose.
Adds a disposable to the collection of disposables. If this instance is already disposed or disposing, then is disposed immediately.
The disposable to add to our collection.
Creates a disposable that disposes a collection of disposables.
The disposables to dispose.
Creates a disposable that disposes a collection of disposables.
The disposables to dispose.
A field containing a bound action.
The type of context for the action.
Initializes the field with the specified action and context.
The action delegate.
The context.
Whether the field is empty.
Atomically retrieves the bound action from the field and sets the field to null. May return null.
Attempts to update the context of the bound action stored in the field. Returns false if the field is null.
The function used to update an existing context. This may be called more than once if more than one thread attempts to simultanously update the context.
An action delegate bound with its context.
Executes the action. This should only be done after the bound action is retrieved from a field by .
A singleton disposable that does nothing when disposed.
Does nothing.
Gets the instance of .
A base class for disposables that need exactly-once semantics in a threadsafe way. All disposals of this instance block until the disposal is complete.
The type of "context" for the derived disposable. Since the context should not be modified, strongly consider making this an immutable type.
If is called multiple times, only the first call will execute the disposal code. Other calls to will wait for the disposal to complete.
The context. This is never null. This is empty if this instance has already been disposed (or is being disposed).
Creates a disposable for the specified context.
The context passed to .
Whether this instance is currently disposing or has been disposed.
Whether this instance is disposed (finished disposing).
Whether this instance is currently disposing, but not finished yet.
The actul disposal method, called only once from .
The context for the disposal operation.
Disposes this instance.
If is called multiple times, only the first call will execute the disposal code. Other calls to will wait for the disposal to complete.
Attempts to update the stored context. This method returns false if this instance has already been disposed (or is being disposed).
The function used to update an existing context. This may be called more than once if more than one thread attempts to simultanously update the context.
A base class for disposables that need exactly-once semantics in a threadsafe way.
The type of "context" for the derived disposable. Since the context should not be modified, strongly consider making this an immutable type.
If is called multiple times, only the first call will execute the disposal code. Other calls to will not wait for the disposal to complete.
The context. This is never null. This is empty if this instance has already been disposed (or is being disposed).
Creates a disposable for the specified context.
The context passed to .
Whether this instance has been disposed (or is being disposed).
The actul disposal method, called only once from .
The context for the disposal operation.
Disposes this instance.
If is called multiple times, only the first call will execute the disposal code. Other calls to will not wait for the disposal to complete.
Attempts to update the stored context. This method returns false if this instance has already been disposed (or is being disposed).
The function used to update an existing context. This may be called more than once if more than one thread attempts to simultanously update the context.