Share via


Qbservable.FromEventPattern Method (IQbservableProvider, Expression<Action<EventHandler>>, Expression<Action<EventHandler>>)

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

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function FromEventPattern ( _
    provider As IQbservableProvider, _
    addHandler As Expression(Of Action(Of EventHandler)), _
    removeHandler As Expression(Of Action(Of EventHandler)) _
) As IQbservable(Of EventPattern(Of EventArgs))
'Usage
Dim provider As IQbservableProvider
Dim addHandler As Expression(Of Action(Of EventHandler))
Dim removeHandler As Expression(Of Action(Of EventHandler))
Dim returnValue As IQbservable(Of EventPattern(Of EventArgs))

returnValue = provider.FromEventPattern(addHandler, _
    removeHandler)
public static IQbservable<EventPattern<EventArgs>> FromEventPattern(
    this IQbservableProvider provider,
    Expression<Action<EventHandler>> addHandler,
    Expression<Action<EventHandler>> removeHandler
)
[ExtensionAttribute]
public:
static IQbservable<EventPattern<EventArgs^>^>^ FromEventPattern(
    IQbservableProvider^ provider, 
    Expression<Action<EventHandler^>^>^ addHandler, 
    Expression<Action<EventHandler^>^>^ removeHandler
)
static member FromEventPattern : 
        provider:IQbservableProvider * 
        addHandler:Expression<Action<EventHandler>> * 
        removeHandler:Expression<Action<EventHandler>> -> IQbservable<EventPattern<EventArgs>> 
public static function FromEventPattern(
    provider : IQbservableProvider, 
    addHandler : Expression<Action<EventHandler>>, 
    removeHandler : Expression<Action<EventHandler>>
) : IQbservable<EventPattern<EventArgs>>

Parameters

Return Value

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

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IQbservableProvider. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

See Also

Reference

Qbservable Class

FromEventPattern Overload

System.Reactive.Linq Namespace