Type.FilterName Campo

Definizione

Rappresenta il filtro membro usato sui nomi, che fa distinzione tra maiuscole e minuscole. Questo campo è di sola lettura.

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

MemberFilter

Esempio

L'esempio di codice seguente ottiene i metodi associati al tipo definito Application dall'utente.

// 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 contiene un riferimento al delegato usato dal FindMembers metodo . Il metodo incapsulato da questo delegato accetta due parametri: il primo è un MemberInfo oggetto e il secondo è un oggetto Object . Il metodo determina se MemberInfo l'oggetto corrisponde ai criteri specificati da Object . A Object viene assegnato un valore stringa, che può includere un carattere jolly "*" finale. È supportata solo la corrispondenza di stringhe finali con caratteri jolly.

Ad esempio, Object a può essere assegnato il valore "Byte*". In tal caso, quando il delegato viene richiamato, restituirà solo se il metodo rappresentato dall'oggetto ha un nome che FilterName true inizia con MemberInfo "Byte".

Si applica a

Vedi anche