Export (0) Print
Expand All

Observable.FromEventPattern Method (Action(Of EventHandler), Action(Of EventHandler))

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

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

'Declaration
Public Shared Function FromEventPattern ( _
	addHandler As Action(Of EventHandler), _
	removeHandler As Action(Of EventHandler) _
) As IObservable(Of EventPattern(Of EventArgs))
'Usage
Dim addHandler As Action(Of EventHandler)
Dim removeHandler As Action(Of EventHandler)
Dim returnValue As IObservable(Of EventPattern(Of EventArgs))

returnValue = Observable.FromEventPattern(addHandler, _
	removeHandler)

Parameters

addHandler
Type: System.Action(Of EventHandler)
The action that attaches the given event handler to the underlying .NET event.
removeHandler
Type: System.Action(Of EventHandler)
The action that detaches the given event handler from the underlying .NET event.

Return Value

Type: System.IObservable(Of EventPattern(Of EventArgs))
The observable sequence that contains data representations of invocations of the underlying .NET event.
Show:
© 2014 Microsoft