Share via


Disposable.Create Method

Creates the disposable that invokes the specified action when disposed.

Namespace:  System.Reactive.Disposables
Assembly:  System.Reactive (in System.Reactive.dll)

Syntax

'Declaration
Public Shared Function Create ( _
    dispose As Action _
) As IDisposable
'Usage
Dim dispose As Action
Dim returnValue As IDisposable

returnValue = Disposable.Create(dispose)
public static IDisposable Create(
    Action dispose
)
public:
static IDisposable^ Create(
    Action^ dispose
)
static member Create : 
        dispose:Action -> IDisposable 
public static function Create(
    dispose : Action
) : IDisposable

Parameters

  • dispose
    Type: System.Action
    The action to run during IDisposable.Dispose.

Return Value

Type: System.IDisposable
The disposable object that runs the given action upon disposal.

See Also

Reference

Disposable Class

System.Reactive.Disposables Namespace