System.Runtime.CompilerServices.MethodImplAttribute Class

Specifies the details of how a method is implemented. This class cannot be inherited.

See Also: MethodImplAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.All, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class MethodImplAttribute : Attribute

Remarks

You can apply this attribute to methods or constructors.

This attribute lets you customize the configuration of the method or constructor to which it applies by supplying a System.Runtime.CompilerServices.MethodImplOptions value to its class constructor. The members of the System.Runtime.CompilerServices.MethodImplOptions enumeration correspond to bit fields in the CorMethodImpl metadata table. This means that information on the attribute cannot be retrieved at run time by calling the System.Reflection.MemberInfo.GetCustomAttributes(bool) method; instead, it is retrieved by calling either the MethodInfo.GetMethodImplementationFlags or the ConstructorInfo.GetMethodImplementationFlags method.

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Requirements

Namespace: System.Runtime.CompilerServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0