Compartilhar via


WindowsRuntimeMarshal.AddEventHandler<T> Método

Definição

Adiciona o manipulador de eventos especificado a um evento Windows Runtime.

Esta API dá suporte à infraestrutura do produto e não deve ser usada diretamente do seu 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

O tipo do delegado que representa o manipulador de eventos.

Parâmetros

addMethod
Func<T,EventRegistrationToken>

Um delegado que representa o método que Adiciona manipuladores de eventos ao evento Windows Runtime.

removeMethod
Action<EventRegistrationToken>

Um delegado que representa o método que remove manipuladores de eventos do evento Windows Runtime.

handler
T

Um delegado representa o manipulador de eventos adicionado.

Atributos

Exceções

addMethod é null.

  • ou - removeMethod é null.

Aplica-se a