Observable

Observable.FromEventPattern Method (Object, String)

Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence, using reflection to find an instance event.

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

Syntax

'Declaration
Public Shared Function FromEventPattern ( _
    target As Object, _
    eventName As String _
) As IObservable(Of EventPattern(Of EventArgs))
'Usage
Dim target As Object
Dim eventName As String
Dim returnValue As IObservable(Of EventPattern(Of EventArgs))

returnValue = Observable.FromEventPattern(target, _
    eventName)
public static IObservable<EventPattern<EventArgs>> FromEventPattern(
    Object target,
    string eventName
)
public:
static IObservable<EventPattern<EventArgs^>^>^ FromEventPattern(
    Object^ target, 
    String^ eventName
)
static member FromEventPattern : 
        target:Object * 
        eventName:string -> IObservable<EventPattern<EventArgs>> 
public static function FromEventPattern(
    target : Object, 
    eventName : String
) : IObservable<EventPattern<EventArgs>>

Parameters

  • target
    Type: System.Object
    The object instance that exposes the event to convert.

  • eventName
    Type: System.String
    The name of the event to convert.

Return Value

Type: System.IObservable<EventPattern<EventArgs>>
The observable sequence that contains data representations of invocations of the underlying .NET event.

See Also

Reference

Observable Class

FromEventPattern Overload

System.Reactive.Linq Namespace

Observable.FromEventPattern Method (Type, String)

Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence, using reflection to find a static event.

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

Syntax

'Declaration
Public Shared Function FromEventPattern ( _
    type As Type, _
    eventName As String _
) As IObservable(Of EventPattern(Of EventArgs))
'Usage
Dim type As Type
Dim eventName As String
Dim returnValue As IObservable(Of EventPattern(Of EventArgs))

returnValue = Observable.FromEventPattern(type, _
    eventName)
public static IObservable<EventPattern<EventArgs>> FromEventPattern(
    Type type,
    string eventName
)
public:
static IObservable<EventPattern<EventArgs^>^>^ FromEventPattern(
    Type^ type, 
    String^ eventName
)
static member FromEventPattern : 
        type:Type * 
        eventName:string -> IObservable<EventPattern<EventArgs>> 
public static function FromEventPattern(
    type : Type, 
    eventName : String
) : IObservable<EventPattern<EventArgs>>

Parameters

  • type
    Type: System.Type
    The type that exposes the static event to convert.

  • eventName
    Type: System.String
    The name of the event to convert.

Return Value

Type: System.IObservable<EventPattern<EventArgs>>
The observable sequence that contains data representations of invocations of the underlying .NET event.

See Also

Reference

Observable Class

FromEventPattern Overload

System.Reactive.Linq Namespace

Observable.FromEventPattern Method

Include Protected Members
Include Inherited Members

Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

NameDescriptionPublic methodStatic memberFromEventPattern(Action<EventHandler>, Action<EventHandler>)Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence with the specified add handler and remove handler.Public methodStatic memberFromEventPattern(Action, Action)Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence with a specified add handler and remove handler.Public methodStatic memberFromEventPattern<TDelegate, TEventArgs>(Action, Action)Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence with the specified add handler and remove handler.Public methodStatic memberFromEventPattern(Object, String)Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence, using reflection to find an instance event.Public methodStatic memberFromEventPattern(Object, String)Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence, using reflection to find an instance event.Public methodStatic memberFromEventPattern(Type, String)Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence, using reflection to find a static event.Public methodStatic memberFromEventPattern(Type, String)Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence, using reflection to find a static event.Public methodStatic memberFromEventPattern<TDelegate, TEventArgs>(Func<EventHandler, TDelegate>, Action, Action)Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence with the specified conversion, add handler and remove handler.Top

See Also

Reference

Observable Class

System.Reactive.Linq Namespace

Observable.FromEventPattern Method (Action<EventHandler>, Action<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)

Syntax

'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)
public static IObservable<EventPattern<EventArgs>> FromEventPattern(
    Action<EventHandler> addHandler,
    Action<EventHandler> removeHandler
)
public:
static IObservable<EventPattern<EventArgs^>^>^ FromEventPattern(
    Action<EventHandler^>^ addHandler, 
    Action<EventHandler^>^ removeHandler
)
static member FromEventPattern : 
        addHandler:Action<EventHandler> * 
        removeHandler:Action<EventHandler> -> IObservable<EventPattern<EventArgs>> 
public static function FromEventPattern(
    addHandler : Action<EventHandler>, 
    removeHandler : Action<EventHandler>
) : IObservable<EventPattern<EventArgs>>

Parameters

  • addHandler
    Type: System.Action<EventHandler>
    The action that attaches the given event handler to the underlying .NET event.

  • removeHandler
    Type: System.Action<EventHandler>
    The action that detaches the given event handler from the underlying .NET event.

Return Value

Type: System.IObservable<EventPattern<EventArgs>>
The observable sequence that contains data representations of invocations of the underlying .NET event.

See Also

Reference

Observable Class

FromEventPattern Overload

System.Reactive.Linq Namespace