Export (0) Print
Expand All

Observable.FromEventPattern<TDelegate, TEventArgs> Method (Action<TDelegate>, Action<TDelegate>)

Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence with the specified add handler and remove handler.

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

public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TDelegate, TEventArgs>(
	Action<TDelegate> addHandler,
	Action<TDelegate> removeHandler
)
where TEventArgs : EventArgs

Type Parameters

TDelegate

The type of delegate.

TEventArgs

The type of event.

Parameters

addHandler
Type: System.Action<TDelegate>
The action that attaches the given event handler to the underlying .NET event.
removeHandler
Type: System.Action<TDelegate>
The action that detaches the given event handler from the underlying .NET event.

Return Value

Type: System.IObservable<EventPattern<TEventArgs>>
The observable sequence that contains data representations of invocations of the underlying .NET event.
Show:
© 2014 Microsoft