Type.FilterName 필드

정의

이름에 사용되는 멤버 필터(대/소문자 구분)를 나타냅니다. 이 필드는 읽기 전용입니다.

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

필드 값

예제

다음 코드 예제에서는 사용자 정의 Application 형식과 연결된 메서드를 가져옵니다.

// 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 = 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
let mi = typeof<Application>.FindMembers(MemberTypes.Constructor |||
             MemberTypes.Method,
             BindingFlags.Public ||| BindingFlags.Static ||| BindingFlags.NonPublic |||
             BindingFlags.Instance ||| BindingFlags.DeclaredOnly,
             Type.FilterName, "*")
printfn $"Number of methods (includes constructors): {mi.Length}"
' 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())

설명

이 필드는 메서드에서 사용하는 대리자를 참조합니다 FindMembers . 이 대리자에서 캡슐화된 메서드는 두 개의 매개 변수를 MemberInfo 사용합니다. 첫 번째는 개체이고 두 번째는 입니다 Object. 메서드는 개체가 에 MemberInfo 지정된 Object조건과 일치하는지 여부를 결정합니다. 는 Object 후행 "*" 와일드카드 문자를 포함할 수 있는 문자열 값이 할당됩니다. 와일드카드 끝 문자열 일치만 지원됩니다.

예를 들어 에 Object "Byte*" 값이 할당될 수 있습니다. 이 경우 대리자를 호출하면 개체가 FilterName 나타내는 MemberInfo 메서드에 "Byte"로 시작하는 이름이 있는 경우에만 반환 true 됩니다.

적용 대상

추가 정보