Export (0) Print
Expand All

Observable.FromEvent(Of TEventArgs) Method (Action(Of Action(Of TEventArgs)), Action(Of Action(Of TEventArgs)))

Converts a .NET event to an observable sequence.

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

'Declaration
Public Shared Function FromEvent(Of TEventArgs) ( _
	addHandler As Action(Of Action(Of TEventArgs)), _
	removeHandler As Action(Of Action(Of TEventArgs)) _
) As IObservable(Of TEventArgs)
'Usage
Dim addHandler As Action(Of Action(Of TEventArgs))
Dim removeHandler As Action(Of Action(Of TEventArgs))
Dim returnValue As IObservable(Of TEventArgs)

returnValue = Observable.FromEvent(addHandler, _
	removeHandler)

Type Parameters

TEventArgs

The type of event.

Parameters

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

Return Value

Type: System.IObservable(Of TEventArgs)
Observable sequence that contains data representations of invocations of the underlying .NET event.
Show:
© 2014 Microsoft