Compartir a través de


WindowsRuntimeMarshal.AddEventHandler<T> Método

Definición

Agrega el controlador de eventos especificado a un evento de Windows Runtime.

Esta API admite la infraestructura de producto y no está pensada para usarse directamente en el código.

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)

Parámetros de tipo

T

Tipo de delegado que representa el controlador de eventos.

Parámetros

addMethod
Func<T,EventRegistrationToken>

Delegado que representa el método que agrega controladores de eventos al evento Windows Runtime.

removeMethod
Action<EventRegistrationToken>

Delegado que representa el método que quita los controladores de eventos del evento Windows Runtime.

handler
T

Delegado que representa el controlador de eventos que se agrega.

Atributos

Excepciones

addMethod es null.

O bien

removeMethod es null.

Se aplica a