Qbservable

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

Converts a .NET event, conforming to the standard .NET event pattern, to an queryable observable sequence with the specified conversion, 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(Of TDelegate, TEventArgs As EventArgs) ( _
    provider As IQbservableProvider, _
    conversion As Expression(Of Func(Of EventHandler(Of TEventArgs), TDelegate)), _
    addHandler As Expression(Of Action(Of TDelegate)), _
    removeHandler As Expression(Of Action(Of TDelegate)) _
) As IQbservable(Of EventPattern(Of TEventArgs))
'Usage
Dim provider As IQbservableProvider
Dim conversion As Expression(Of Func(Of EventHandler(Of TEventArgs), TDelegate))
Dim addHandler As Expression(Of Action(Of TDelegate))
Dim removeHandler As Expression(Of Action(Of TDelegate))
Dim returnValue As IQbservable(Of EventPattern(Of TEventArgs))

returnValue = provider.FromEventPattern(conversion, _
    addHandler, removeHandler)
public static IQbservable<EventPattern<TEventArgs>> FromEventPattern<TDelegate, TEventArgs>(
    this IQbservableProvider provider,
    Expression<Func<EventHandler<TEventArgs>, TDelegate>> conversion,
    Expression<Action<TDelegate>> addHandler,
    Expression<Action<TDelegate>> removeHandler
)
where TEventArgs : EventArgs
[ExtensionAttribute]
public:
generic<typename TDelegate, typename TEventArgs>
where TEventArgs : EventArgs
static IQbservable<EventPattern<TEventArgs>^>^ FromEventPattern(
    IQbservableProvider^ provider, 
    Expression<Func<EventHandler<TEventArgs>^, TDelegate>^>^ conversion, 
    Expression<Action<TDelegate>^>^ addHandler, 
    Expression<Action<TDelegate>^>^ removeHandler
)
static member FromEventPattern : 
        provider:IQbservableProvider * 
        conversion:Expression<Func<EventHandler<'TEventArgs>, 'TDelegate>> * 
        addHandler:Expression<Action<'TDelegate>> * 
        removeHandler:Expression<Action<'TDelegate>> -> IQbservable<EventPattern<'TEventArgs>>  when 'TEventArgs : EventArgs
JScript does not support generic types and methods.

Type Parameters

  • TDelegate
    The type of delegate.

  • TEventArgs
    The type for the event.

Parameters

Return Value

Type: System.Reactive.Linq.IQbservable<EventPattern<TEventArgs>>
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

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

Converts a .NET event, conforming to the standard .NET event pattern, to an queryable observable sequence with the 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(Of TDelegate, TEventArgs As EventArgs) ( _
    provider As IQbservableProvider, _
    addHandler As Expression(Of Action(Of TDelegate)), _
    removeHandler As Expression(Of Action(Of TDelegate)) _
) As IQbservable(Of EventPattern(Of TEventArgs))
'Usage
Dim provider As IQbservableProvider
Dim addHandler As Expression(Of Action(Of TDelegate))
Dim removeHandler As Expression(Of Action(Of TDelegate))
Dim returnValue As IQbservable(Of EventPattern(Of TEventArgs))

returnValue = provider.FromEventPattern(addHandler, _
    removeHandler)
public static IQbservable<EventPattern<TEventArgs>> FromEventPattern<TDelegate, TEventArgs>(
    this IQbservableProvider provider,
    Expression<Action<TDelegate>> addHandler,
    Expression<Action<TDelegate>> removeHandler
)
where TEventArgs : EventArgs
[ExtensionAttribute]
public:
generic<typename TDelegate, typename TEventArgs>
where TEventArgs : EventArgs
static IQbservable<EventPattern<TEventArgs>^>^ FromEventPattern(
    IQbservableProvider^ provider, 
    Expression<Action<TDelegate>^>^ addHandler, 
    Expression<Action<TDelegate>^>^ removeHandler
)
static member FromEventPattern : 
        provider:IQbservableProvider * 
        addHandler:Expression<Action<'TDelegate>> * 
        removeHandler:Expression<Action<'TDelegate>> -> IQbservable<EventPattern<'TEventArgs>>  when 'TEventArgs : EventArgs
JScript does not support generic types and methods.

Type Parameters

  • TDelegate
    The type of delegate.

  • TEventArgs
    The type for the event.

Parameters

Return Value

Type: System.Reactive.Linq.IQbservable<EventPattern<TEventArgs>>
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