WindowsRuntimeMarshal.AddEventHandler<T>(Func<T,EventRegistrationToken>, Action<EventRegistrationToken>, T) Método

Definição

Adiciona o manipulador de eventos especificado a um evento Windows Runtime.Adds the specified event handler to a Windows Runtime event.

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.The type of the delegate that represents the event handler.

Parâmetros

addMethod
Func<T,EventRegistrationToken>

Um delegado que representa o método que Adiciona manipuladores de eventos ao evento Windows Runtime.A delegate that represents the method that adds event handlers to the Windows Runtime event.

removeMethod
Action<EventRegistrationToken>

Um delegado que representa o método que remove manipuladores de eventos do evento Windows Runtime.A delegate that represents the method that removes event handlers from the Windows Runtime event.

handler
T

Um delegado representa o manipulador de eventos adicionado.A delegate the represents the event handler that is added.

Atributos

Exceções

addMethod é null.addMethod is null.

- ou --or- removeMethod é null.removeMethod is null.

Aplica-se a