Bagikan melalui


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