Observable.FromEvent<TDelegate, TEventArgs-Methode> (Action<TDelegate>, Action<TDelegate>)
Konvertiert ein .NET-Ereignis in eine beobachtbare Sequenz.
Namespace:System.Reactive.Linq
Versammlung: System.Reactive (in System.Reactive.dll)
Syntax
'Declaration
Public Shared Function FromEvent(Of TDelegate, TEventArgs) ( _
addHandler As Action(Of TDelegate), _
removeHandler As Action(Of TDelegate) _
) As IObservable(Of TEventArgs)
'Usage
Dim addHandler As Action(Of TDelegate)
Dim removeHandler As Action(Of TDelegate)
Dim returnValue As IObservable(Of TEventArgs)
returnValue = Observable.FromEvent(addHandler, _
removeHandler)
public static IObservable<TEventArgs> FromEvent<TDelegate, TEventArgs>(
Action<TDelegate> addHandler,
Action<TDelegate> removeHandler
)
public:
generic<typename TDelegate, typename TEventArgs>
static IObservable<TEventArgs>^ FromEvent(
Action<TDelegate>^ addHandler,
Action<TDelegate>^ removeHandler
)
static member FromEvent :
addHandler:Action<'TDelegate> *
removeHandler:Action<'TDelegate> -> IObservable<'TEventArgs>
JScript does not support generic types and methods.
Typparameter
- Tdelegate
Der Typ des Delegaten.
- TEventArgs
Art des Ereignisses.
Parameter
- Addhandler
Typ: System.Action<TDelegate>
Aktion, die den angegebenen Ereignishandler an das zugrunde liegende .NET-Ereignis anfügt.
- Removehandler
Typ: System.Action<TDelegate>
Aktion, die den angegebenen Ereignishandler vom zugrunde liegenden .NET-Ereignis trennt.
Rückgabewert
Typ: System.IObservable<TEventArgs>
Beobachtbare Sequenz, die Datendarstellungen von Aufrufen des zugrunde liegenden .NET-Ereignisses enthält.