C# Class Microsoft.Common.Core.Disposables.Disposable.AnonymousDisposable

Represents an Action-based disposable.
Inheritance: IDisposable
Mostra file Open project: Microsoft/RTVS

Public Methods

Method Description
AnonymousDisposable ( System.Action dispose ) : System

Constructs a new disposable with the given action used for disposal.

Dispose ( ) : void

Calls the disposal action if and only if the current instance hasn't been disposed yet.

Method Details

AnonymousDisposable() public method

Constructs a new disposable with the given action used for disposal.
public AnonymousDisposable ( System.Action dispose ) : System
dispose System.Action Disposal action which will be run upon calling Dispose.
return System

Dispose() public method

Calls the disposal action if and only if the current instance hasn't been disposed yet.
public Dispose ( ) : void
return void