Type.FilterName フィールド
アセンブリ: mscorlib (mscorlib.dll 内)


このフィールドは、FindMembers メソッドで使用されるデリゲートへの参照を保持します。このデリゲートによってカプセル化されたメソッドは、MemberInfo オブジェクト、Object という 2 つのパラメータを受け取ります。このメソッドは、MemberInfo オブジェクトが Object に指定した基準に一致するかどうかを判断します。Object には文字列値が代入されます。この値の末尾には、ワイルドカード文字 "*" を含むことができます。基準として指定できるのは、ワイルドカード文字を末尾に指定した文字列だけです。
たとえば、Object に "Byte*" という値を代入するとします。この場合、FilterName デリゲートが呼び出されると、呼び出されたデリゲートは MemberInfo オブジェクトで表されるメソッドの名前が "Byte" で始まる場合にだけ true を返します。

ユーザー定義の Application 型に関連付けられているメソッドを取得する方法については、次のコード例を参照してください。
' Get the set of methods associated with the type Dim mi As MemberInfo() = _ GetType(Application).FindMembers( _ MemberTypes.Constructor Or MemberTypes.Method, _ BindingFlags.DeclaredOnly, _ Type.FilterName, "*") Console.WriteLine("Number of methods (includes constructors): " & _ mi.Length.ToString())
// Get the set of methods associated with the type MemberInfo[] mi = typeof(Application).FindMembers(MemberTypes.Constructor | MemberTypes.Method, BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly, Type.FilterName, "*"); Console.WriteLine("Number of methods (includes constructors): " + mi.Length);
// Get the set of methods associated with the type array<MemberInfo^>^ mi = Application::typeid->FindMembers( (MemberTypes)(MemberTypes::Constructor | MemberTypes::Method), (BindingFlags)(BindingFlags::Public | BindingFlags::Static | BindingFlags::NonPublic | BindingFlags::Instance | BindingFlags::DeclaredOnly) , Type::FilterName, "*" ); Console::WriteLine( "Number of methods (includes constructors): {0}", mi->Length );
// Get the set of methods associated with the type MemberInfo mi[] = Application.class.ToType().FindMembers (MemberTypes.Constructor | MemberTypes.Method, BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly, Type.FilterName, "*"); Console.WriteLine(("Number of methods (includes constructors): " + mi.length));
// Get the set of methods associated with the type var mi : MemberInfo[] = Application.FindMembers(MemberTypes.Constructor | MemberTypes.Method, BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly, Type.FilterName, "*"); Console.WriteLine("Number of methods (includes constructors): " + mi.Length);

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Type.FilterName フィールドのページへのリンク