Share via


WindowsRuntimeMarshal.AddEventHandler<T> メソッド

定義

指定されたイベントハンドラーを Windows ランタイムイベントに追加します。

この API は製品インフラストラクチャをサポートします。コードから直接使用するものではありません。

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)

型パラメーター

T

イベント ハンドラーを表すデリゲートの型。

パラメーター

addMethod
Func<T,EventRegistrationToken>

Windows ランタイムイベントにイベントハンドラーを追加するメソッドを表すデリゲート。

removeMethod
Action<EventRegistrationToken>

Windows ランタイムイベントからイベントハンドラーを削除するメソッドを表すデリゲート。

handler
T

追加されるイベント ハンドラーを表すデリゲート。

属性

例外

addMethodnullです。

または removeMethodnullです。

適用対象