WindowsRuntimeMarshal.AddEventHandler<T> Metoda

Definicja

Dodaje określony program obsługi zdarzeń do zdarzenia środowisko wykonawcze systemu Windows.

Ten interfejs API obsługuje infrastrukturę produktu i nie jest przeznaczony do użycia bezpośrednio z poziomu kodu.

public:
generic <typename T>
 static void AddEventHandler(Func<T, System::Runtime::InteropServices::WindowsRuntime::EventRegistrationToken> ^ addMethod, Action<System::Runtime::InteropServices::WindowsRuntime::EventRegistrationToken> ^ removeMethod, T handler);
[System.Security.SecurityCritical]
public static void AddEventHandler<T> (Func<T,System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> addMethod, Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> removeMethod, T handler);
public static void AddEventHandler<T> (Func<T,System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> addMethod, Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> removeMethod, T handler);
[<System.Security.SecurityCritical>]
static member AddEventHandler : Func<'T, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> * Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> * 'T -> unit
static member AddEventHandler : Func<'T, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> * Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> * 'T -> unit
Public Shared Sub AddEventHandler(Of T) (addMethod As Func(Of T, EventRegistrationToken), removeMethod As Action(Of EventRegistrationToken), handler As T)

Parametry typu

T

Typ delegata reprezentującego program obsługi zdarzeń.

Parametry

addMethod
Func<T,EventRegistrationToken>

Delegat reprezentujący metodę, która dodaje programy obsługi zdarzeń do zdarzenia środowisko wykonawcze systemu Windows.

removeMethod
Action<EventRegistrationToken>

Delegat reprezentujący metodę, która usuwa programy obsługi zdarzeń z zdarzenia środowisko wykonawcze systemu Windows.

handler
T

Delegat reprezentuje program obsługi zdarzeń, który jest dodawany.

Atrybuty

Wyjątki

addMethod to null.

-lub-

removeMethod to null.

Dotyczy