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

Definizione

Rappresenta il filtro membro usato sui nomi, che fa distinzione tra maiuscole e minuscole.Represents the case-sensitive member filter used on names. Questo campo è di sola lettura.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 

Valore del campo

Esempi

Nell'esempio di codice seguente vengono ottenuti i metodi associati al tipo Application definito dall'utente.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())

Commenti

Questo campo include un riferimento al delegato utilizzato dal FindMembers metodo.This field holds a reference to the delegate used by the FindMembers method. Il metodo incapsulato da questo delegato accetta due parametri: il primo è MemberInfo un oggetto e il secondo Objectè.The method encapsulated by this delegate takes two parameters: the first is a MemberInfo object and the second is an Object. Il metodo determina se l' MemberInfo oggetto corrisponde ai criteri specificati Objectda.The method determines whether the MemberInfo object matches the criteria specified by the Object. Al Object viene assegnato un valore stringa, che può includere un carattere jolly "*" finale.The Object is assigned a string value, which may include a trailing "*" wildcard character. È supportata solo la corrispondenza di stringhe finali con caratteri jolly.Only wildcard end string matching is supported.

Ad esempio, Object può essere assegnato il valore "byte *".For example, the Object may be assigned the value "Byte*". In tal caso, quando il FilterName delegato viene richiamato, viene restituito true solo se MemberInfo il metodo rappresentato dall'oggetto ha un nome che inizia con "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".

Si applica a

Vedi anche