O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

MethodImplAttributes

Synopsis

These flags specify how a method has been implemented. Managed, Unmanaged, and ManagedMask indicate whether the method is managed or unmanaged code. If a method allows only one thread to execute it at a time, then its Synchronized flag is set. ForwardRef specifies that the method has not been defined, and InternalCall indicates that the method is an internal call. IL and OPTIL specify the code is IL or optimized IL. If the method is provided by the runtime, Runtime should be set, and if the method implementation is native, Native is marked. When a method should not be inlined during optimization, NoInlining is set. When the method signature should be exported exactly as specified, PreserveSig is set.

public enum MethodImplAttributes {
   Managed = 0,
   IL = 0,
   Native = 1,
   OPTIL = 2,
   Runtime = 3,
   CodeTypeMask = 3,
   Unmanaged = 4,
   ManagedMask = 4,
   NoInlining = 8,
   ForwardRef = 16,
   Synchronized = 32,
   PreserveSig = 128,
   InternalCall = 4096,
   MaxMethodImplVal = 65535
}

Hierarchy

System.ObjectSystem.ValueTypeSystem.Enum(System.IComparable, System.IFormattable, System.IConvertible)MethodImplAttributes

Returned By

MethodBase.GetMethodImplementationFlags()

Passed To

System.Reflection.Emit.ConstructorBuilder.SetImplementationFlags(), System.Reflection.Emit.MethodBuilder.SetImplementationFlags()

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required