ActionDisposable Class

Implements IDisposable by invoking a given Action upon disposal.

public class ActionDisposable : IDisposable
Implements

Constructors

NameDescription
ActionDisposable(Action)Initializes a new instance of the ActionDisposable class.

ActionDisposable(Action)

Initializes a new instance of the ActionDisposable class.

public ActionDisposable(Action onDispose)

Parameters

onDispose Action
The Action to call upon the first call to ActionDisposable.Dispose.

Exceptions

ArgumentNullException
onDispose is null.

See also

Methods

NameDescription
Dispose()When invoked for the first time, invokes the Action passed to the constructor. If / when invoked again, this method does nothing.

Dispose()

When invoked for the first time, invokes the Action passed to the constructor.

If / when invoked again, this method does nothing.

public void Dispose()