EventInfo.EventHandlerType プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)



' The following example uses instances of classes in ' the System.Reflection namespace to discover an event argument type. Imports System Imports System.Reflection Imports Microsoft.VisualBasic Public Class MainClass Delegate Sub MyDelegate(ByVal i As Integer) Public Event ev As MyDelegate Public Sub Fire(ByVal i As Integer) AddHandler ev, AddressOf Me.Fire End Sub 'Fire Public Shared Sub Main() Dim deleg As Type = GetType(MainClass).GetEvent("ev").EventHandlerType Dim invoke As MethodInfo = deleg.GetMethod("Invoke") Dim pars As ParameterInfo() = invoke.GetParameters() Dim p As ParameterInfo For Each p In pars Console.WriteLine(p.ParameterType) Next p End Sub 'Main End Class 'MainClass
// The following example uses instances of classes in // the System.Reflection namespace to discover an event argument type. using System; using System.Reflection; public delegate void MyDelegate(int i); public class MainClass { public event MyDelegate ev; public void Fire(int i) { ev += new MyDelegate(this.Fire); } public static void Main() { Type deleg = typeof(MainClass).GetEvent("ev").EventHandlerType; MethodInfo invoke = deleg.GetMethod("Invoke"); ParameterInfo[] pars = invoke.GetParameters(); foreach (ParameterInfo p in pars) { Console.WriteLine(p.ParameterType); } } }
// The following example uses instances of classes in // the System::Reflection namespace to discover an event argument type. using namespace System; using namespace System::Reflection; public delegate void MyDelegate( int i ); public ref class MainClass { public: event MyDelegate^ ev; void Fire( int i ) { ev += gcnew MyDelegate( this, &MainClass::Fire ); } }; int main() { Type^ deleg = MainClass::typeid->GetEvent( "ev" )->EventHandlerType; MethodInfo^ invoke = deleg->GetMethod( "Invoke" ); array<ParameterInfo^>^pars = invoke->GetParameters(); System::Collections::IEnumerator^ myEnum = pars->GetEnumerator(); while ( myEnum->MoveNext() ) { ParameterInfo^ p = safe_cast<ParameterInfo^>(myEnum->Current); Console::WriteLine( p->ParameterType ); } }


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


_EventInfo.EventHandlerType プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)


このメソッドは、アンマネージ コードからマネージ クラスにアクセスするためのメソッドであるため、マネージ コードからは呼び出さないでください。
EventHandlerType プロパティは、このイベントに関連付けられている基になるイベント ハンドラ デリゲートの Type オブジェクトを取得します。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からEventInfo.EventHandlerTypeを検索する場合は、下記のリンクをクリックしてください。

- EventInfo.EventHandlerTypeのページへのリンク