MethodImplAttributes Enumerazione
Definizione
Specifica i flag per gli attributi di un'implementazione del metodo.Specifies flags for the attributes of a method implementation.
Questa enumerazione ha un attributo FlagsAttribute che consente una combinazione bit per bit dei valori del relativo membro.
Questa API supporta l'infrastruttura del prodotto e non è previsto che venga usata direttamente dal codice.
public enum class MethodImplAttributes
public enum MethodImplAttributes
[System.Flags]
[System.Serializable]
public enum MethodImplAttributes
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum MethodImplAttributes
type MethodImplAttributes =
[<System.Flags>]
[<System.Serializable>]
type MethodImplAttributes =
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type MethodImplAttributes =
Public Enum MethodImplAttributes
- Ereditarietà
- Attributi
Campi
AggressiveInlining | 256 | Specifica che, se possibile, il metodo deve essere impostato come inline.Specifies that the method should be inlined wherever possible. |
AggressiveOptimization | 512 | Specifica che il metodo deve essere ottimizzato quando possibile.Specifies that the method should be optimized whenever possible. |
CodeTypeMask | 3 | Specifica i flag relativi al tipo di codice.Specifies flags about code type. |
ForwardRef | 16 | Specifica che il metodo non è definito.Specifies that the method is not defined. |
IL | 0 | Specifica che il metodo è implementato in MSIL (Microsoft Intermediate Language).Specifies that the method implementation is in Microsoft intermediate language (MSIL). |
InternalCall | 4096 | Specifica una chiamata interna.Specifies an internal call. |
Managed | 0 | Specifica che il metodo è implementato in codice gestito.Specifies that the method is implemented in managed code. |
ManagedMask | 4 | Specifica se il metodo è implementato in codice gestito o non gestito.Specifies whether the method is implemented in managed or unmanaged code. |
MaxMethodImplVal | 65535 | Specifica un valore di controllo dell'intervallo.Specifies a range check value. |
Native | 1 | Specifica che l'implementazione del metodo è nativa.Specifies that the method implementation is native. |
NoInlining | 8 | Specifica che il metodo non può essere impostato come inline.Specifies that the method cannot be inlined. |
NoOptimization | 64 | Specifica che il metodo non è ottimizzato dal compilatore JIT (Just-In-Time) o dalla generazione del codice nativo (vedere Ngen.exe) durante il debug di possibili problemi di generazione del codice.Specifies that the method is not optimized by the just-in-time (JIT) compiler or by native code generation (see Ngen.exe) when debugging possible code generation problems. |
OPTIL | 2 | Specifica che il metodo è implementato in OPTIL (Optimized Intermediate Language).Specifies that the method implementation is in Optimized Intermediate Language (OPTIL). |
PreserveSig | 128 | Specifica che la firma del metodo viene esportata esattamente come viene dichiarata.Specifies that the method signature is exported exactly as declared. |
Runtime | 3 | Specifica che l'implementazione del metodo è fornita dal runtime.Specifies that the method implementation is provided by the runtime. |
SecurityMitigations | 1024 | Questo membro è riservato per usi futuri.This member is reserved for future use. È stato introdotto in .NET Framework 4.8.It was introduced in .NET Framework 4.8. |
Synchronized | 32 | Specifica che il metodo è a thread singolo attraverso il corpo.Specifies that the method is single-threaded through the body. I metodi statici ( |
Unmanaged | 4 | Specifica che il metodo è implementato in codice non gestito.Specifies that the method is implemented in unmanaged code. |
Commenti
Gli attributi vengono combinati usando l'operazione OR bit per bit, come indicato di seguito:The attributes are combined using the bitwise OR operation as follows:
Maschere di implementazione del codice:Code implementation masks:
CodeTypeMask
IL
Native
OPTIL
Runtime
Maschere gestite:Managed masks:
ManagedMask
Unmanaged
Managed
Informazioni di implementazione e maschere di interoperabilità:Implementation information and interop masks:
ForwardRef
PreserveSig
InternalCall
Synchronized
NoInlining
NoOptimization
MaxMethodImplVal
SecurityMitigations
(Disponibile a partire da .NET Framework 4,8).SecurityMitigations
(Available starting with .NET Framework 4.8.)
Nota
Il blocco sull'istanza o sul tipo, come con il Synchronized
flag, non è consigliato per i tipi pubblici, perché il codice diverso dal proprio può assumere blocchi su tipi e istanze pubblici.Locking on the instance or on the type, as with the Synchronized
flag, is not recommended for public types, because code other than your own can take locks on public types and instances. Questo potrebbe causare deadlock o altri problemi di sincronizzazione.This might cause deadlocks or other synchronization problems.