Metodo MethodBase.GetMethodImplementationFlags
Aggiornamento: novembre 2007
Quando viene sottoposto a override in una classe derivata, restituisce i flag MethodImplAttributes.
Assembly: mscorlib (in mscorlib.dll)
public abstract MethodImplAttributes GetMethodImplementationFlags()
public abstract function GetMethodImplementationFlags() : MethodImplAttributes
Implementa
_MethodBase.GetMethodImplementationFlags()Nell'esempio riportato di seguito viene definito un costruttore in un assembly dinamico e quindi viene utilizzato il metodo GetMethodImplementationFlags per visualizzare i flag di implementazione dei metodi impostati per impostazione predefinita.
// Define a constructor of the dynamic class. ConstructorBuilder myConstructorBuilder = myTypeBuilder.DefineConstructor( MethodAttributes.Public, CallingConventions.Standard, myConstructorArgs); // Get a reference to the module that contains this constructor. Module myModule = myConstructorBuilder.GetModule(); Console.WriteLine("Module Name : " + myModule.Name); // Get the 'MethodToken' that represents the token for this constructor. MethodToken myMethodToken = myConstructorBuilder.GetToken(); Console.WriteLine("Constructor Token is : " + myMethodToken.Token); // Get the method implementation flags for this constructor. MethodImplAttributes myMethodImplAttributes = myConstructorBuilder.GetMethodImplementationFlags(); Console.WriteLine("MethodImplAttributes : " + myMethodImplAttributes);
// Define a constructor of the dynamic class.
ConstructorBuilder myConstructorBuilder =
myTypeBuilder.DefineConstructor(MethodAttributes.Public,
CallingConventions.Standard, myConstructorArgs);
// Get a reference to the module that contains this constructor.
Module myModule = myConstructorBuilder.GetModule();
Console.WriteLine("Module Name : " + myModule.get_Name());
// Get the 'MethodToken' that represents the token for this constructor.
MethodToken myMethodToken = myConstructorBuilder.GetToken();
Console.WriteLine("Constructor Token is : " + myMethodToken.get_Token());
// Get the method implementation flags for this constructor.
MethodImplAttributes myMethodImplAttributes =
myConstructorBuilder.GetMethodImplementationFlags();
Console.WriteLine("MethodImplAttributes : " + myMethodImplAttributes);
- ReflectionPermission
quando viene richiamata l'associazione tardiva attraverso meccanismi come Type.InvokeMember. Enumerazione associata: ReflectionPermissionFlag.MemberAccess
Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition , Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.