Type.FilterName Type.FilterName Type.FilterName Type.FilterName Field

Definição

Representa o filtro de membro, que diferencia maiúsculas de minúsculas, usado nos nomes.Represents the case-sensitive member filter used on names. Este campo é somente leitura.This field is read-only.

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 

Valor do campo

Exemplos

O exemplo de código a seguir obtém os métodos associados ao tipo definido Application pelo usuário.The following code example gets the methods associated with the user-defined Application type.

// 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
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())

Comentários

Esse campo contém uma referência ao delegado usado pelo FindMembers método.This field holds a reference to the delegate used by the FindMembers method. O método encapsulado por esse delegado usa dois parâmetros: o primeiro é um MemberInfo objeto e o segundo é um Object.The method encapsulated by this delegate takes two parameters: the first is a MemberInfo object and the second is an Object. O método determina se o MemberInfo objeto corresponde aos critérios especificados Objectpelo.The method determines whether the MemberInfo object matches the criteria specified by the Object. O Object é atribuído um valor de cadeia de caracteres, que pode incluir um caractere curinga "*" à direita.The Object is assigned a string value, which may include a trailing "*" wildcard character. Há suporte apenas para correspondência de cadeia de caracteres final de caractere curinga.Only wildcard end string matching is supported.

Por exemplo, o Object valor "byte *" pode ser atribuído a ele.For example, the Object may be assigned the value "Byte*". Nesse caso, quando o FilterName delegado é invocado, ele retornará true somente se MemberInfo o método representado pelo objeto tiver um nome que começa com "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".

Aplica-se a

Veja também