Type.FilterNameIgnoreCase 필드

정의

이름에 사용되는 멤버 필터(대/소문자를 구분하지 않음)를 나타냅니다.Represents the case-insensitive member filter used on names. 이 필드는 읽기 전용입니다.This field is read-only.

public: static initonly System::Reflection::MemberFilter ^ FilterNameIgnoreCase;
public static readonly System.Reflection.MemberFilter FilterNameIgnoreCase;
 staticval mutable FilterNameIgnoreCase : System.Reflection.MemberFilter
Public Shared ReadOnly FilterNameIgnoreCase As MemberFilter 

필드 값

예제

다음 예제에서는 합니다 MemberFilter 대리자를 매개 변수로 전달 합니다 FindMembers 메서드를 메서드 및 해당 특성의 표시를 String 대/소문자를 무시 하 고 문자 "c"로 시작 하는 클래스입니다.The following example gets the MemberFilter delegate, passes it as a parameter to the FindMembers method, and displays the methods and their attributes of the String class that begin with the letter "c", disregarding the case.

using namespace System;
using namespace System::Collections;
using namespace System::Reflection;
using namespace System::Security;
int main()
{
   try
   {
      MemberFilter^ myFilter = Type::FilterNameIgnoreCase;
      Type^ myType = System::String::typeid;
      array<MemberInfo^>^myMemberinfo1 = myType->FindMembers( static_cast<MemberTypes>(MemberTypes::Constructor | MemberTypes::Method), static_cast<BindingFlags>(BindingFlags::Public | BindingFlags::Static | BindingFlags::Instance), myFilter, "C*" );
      IEnumerator^ myEnum = myMemberinfo1->GetEnumerator();
      while ( myEnum->MoveNext() )
      {
         MemberInfo^ myMemberinfo2 = safe_cast<MemberInfo^>(myEnum->Current);
         Console::Write( "\n {0}", myMemberinfo2->Name );
         MemberTypes Mymembertypes = myMemberinfo2->MemberType;
         Console::WriteLine( " is a {0}", Mymembertypes );
      }
   }
   catch ( ArgumentNullException^ e ) 
   {
      Console::Write( "ArgumentNullException : {0}", e->Message );
   }
   catch ( SecurityException^ e ) 
   {
      Console::Write( "SecurityException : {0}", e->Message );
   }
   catch ( Exception^ e ) 
   {
      Console::Write( "Exception : {0}", e->Message );
   }
}
using System;
using System.Reflection;
using System.Security;
public class MyFilterNameIgnoreCaseSample
{
    public static void Main()
    {
        try
        {		
            MemberFilter myFilter = Type.FilterNameIgnoreCase;
            Type myType = typeof(System.String);
            MemberInfo[] myMemberinfo1 = myType.FindMembers(MemberTypes.Constructor
                |MemberTypes.Method, BindingFlags.Public | BindingFlags.Static |
                BindingFlags.Instance, myFilter, "C*");
            foreach (MemberInfo myMemberinfo2 in myMemberinfo1) 
            { 
                Console.Write("\n" + myMemberinfo2.Name);
                MemberTypes Mymembertypes = myMemberinfo2.MemberType; 
                Console.WriteLine(" is a " + Mymembertypes.ToString()); 
            }
        }
        catch(ArgumentNullException e)
        {
            Console.Write("ArgumentNullException : " + e.Message); 
        }   
        catch(SecurityException e)
        {
            Console.Write("SecurityException : " + e.Message); 
        }   
        catch(Exception e)
        {
            Console.Write("Exception : " + e.Message); 
        }
    }
}
Imports System.Reflection
Imports System.Security

Public Class MyFilterNameIgnoreCaseSample
    Public Shared Sub Main()
        Try
            Dim myFilter As MemberFilter = Type.FilterNameIgnoreCase
            Dim myType As Type = GetType(System.String)
            Dim myMemberinfo1 As MemberInfo() = myType.FindMembers(MemberTypes.Constructor Or MemberTypes.Method, BindingFlags.Public Or BindingFlags.Static Or BindingFlags.Instance, myFilter, "C*")
            Dim myMemberinfo2 As MemberInfo
            For Each myMemberinfo2 In myMemberinfo1
                Console.Write((ControlChars.NewLine + myMemberinfo2.Name))
                Dim Mymembertypes As MemberTypes = myMemberinfo2.MemberType
                Console.WriteLine((" is a " + Mymembertypes.ToString()))
            Next myMemberinfo2
        Catch e As ArgumentNullException
            Console.Write("ArgumentNullException : " + e.Message.Tostring())
        Catch e As SecurityException
            Console.Write("SecurityException : " + e.Message.Tostring())
        Catch e As Exception
            Console.Write("Exception : " + e.Message.Tostring())
        End Try
    End Sub
End Class

설명

이 필드는 사용 하는 대리자에 대 한 참조를 포함 합니다 FindMembers 메서드.This field holds a reference to the delegate used by the FindMembers method. 이 대리자로 캡슐화 된 메서드는 두 매개 변수: 첫 번째는 MemberInfo 개체 이며 두 번째는 Object합니다.The method encapsulated by this delegate takes two parameters: the first is a MemberInfo object and the second is an Object. 메서드를 결정 하는지 여부를 MemberInfo 개체에 의해 지정 된 조건과 일치 하는 Object합니다.The method determines whether the MemberInfo object matches the criteria specified by the Object. Object 후행 포함할 수 있는 문자열 값이 할당은 "*" 와일드 카드 문자입니다.The Object is assigned a string value, which may include a trailing "*" wildcard character. 유일한 와일드 카드 최종 문자열 일치가 지원 됩니다.Only wildcard end string matching is supported.

예를 들어를 Object "바이트 *" 값을 할당할 수 있습니다.For example, the Object may be assigned the value "ByTe*". 이런 경우는 FilterName 대리자 호출 되 면 true를 반환만 메서드를 나타내는 경우는 MemberInfo 개체에 이름이 "byte", 대/소문자 무시를 사용 하 여 시작 하는 합니다.In that case, when the FilterName delegate is invoked, it will return true only if the method represented by the MemberInfo object has a name that begins with "byte", ignoring case.

적용 대상

추가 정보