Skip to Main Content
C# in a Nutshell, Second Edition
book

C# in a Nutshell, Second Edition

by Peter Drayton, Ben Albahari, Ted Neward
August 2003
Intermediate to advanced content levelIntermediate to advanced
928 pages
32h 1m
English
O'Reilly Media, Inc.
Content preview from C# in a Nutshell, Second Edition

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 that 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 = 0x00000000,
   IL = 0x00000000,
   Native = 0x00000001,
   OPTIL = 0x00000002,
   Runtime = 0x00000003,
   CodeTypeMask = 0x00000003,
   Unmanaged = 0x00000004,
   ManagedMask = 0x00000004,
   NoInlining = 0x00000008,
   ForwardRef = 0x00000010,
   Synchronized = 0x00000020,
   PreserveSig = 0x00000080,
   InternalCall = 0x00001000,
   MaxMethodImplVal = 0x0000FFFF
}

Hierarchy

System.Object System.ValueType System.Enum(System.IComparable, System.IFormattable, System.IConvertible) MethodImplAttributes

Returned By

MethodBase.GetMethodImplementationFlags( )

Passed To

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# in a Nutshell

C# in a Nutshell

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

C# 7.0 in a Nutshell

Joseph Albahari, Ben Albahari
C# Cookbook, 2nd Edition

C# Cookbook, 2nd Edition

Jay Hilyard, Stephen Teilhet
C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard

Publisher Resources

ISBN: 0596005261Catalog PageErrata