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です。

適用対象