System.Runtime.CompilerServices.MethodImplAttribute Class

public sealed class MethodImplAttribute : Attribute

Base Types

Object
  Attribute
    MethodImplAttribute

Assembly

mscorlib

Library

RuntimeInfrastructure

Summary

Specifies the details of how a method is implemented.

Description

Compilers are required to not preserve this type in metadata as a custom attribute. Instead, compilers are required to emit it directly in the file format, as described in Partition II of the CLI Specification. Metadata consumers, such as the Reflection API, are required to retrieve this data from the file format and return it as if it were a custom attribute.

[Note: This class uses the MethodImplOptions enumeration to describe the implementation details of methods. For most languages, it is recommended that the notions of "forward" and "synchronized" be attached to methods using language syntax instead of custom attributes. ]

Attributes

AttributeUsageAttribute(AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple=false, Inherited=false)

See Also

System.Runtime.CompilerServices Namespace

Members

MethodImplAttribute Constructors

MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions) Constructor
MethodImplAttribute(short) Constructor
MethodImplAttribute() Constructor

MethodImplAttribute Properties

MethodImplAttribute.Value Property


MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions) Constructor

public MethodImplAttribute(MethodImplOptions methodImplOptions);

Summary

Constructs and initializes a new instance of the MethodImplAttribute class using the specified MethodImplOptions value.

Parameters

methodImplOptions
A MethodImplOptions value that specifies a property of the method attributed by the current instance.

See Also

System.Runtime.CompilerServices.MethodImplAttribute Class, System.Runtime.CompilerServices Namespace

MethodImplAttribute(short) Constructor

public MethodImplAttribute(short value);

Summary

Constructs and initializes a new instance of the MethodImplAttribute class with the specified Int16 value interpreted as a MethodImplOptions value.

Parameters

value
A Int16 that is interpreted as a bit-field that represents the desired MethodImplOptions value, which specifies a property of the method attributed by the current instance.

See Also

System.Runtime.CompilerServices.MethodImplAttribute Class, System.Runtime.CompilerServices Namespace

MethodImplAttribute() Constructor

public MethodImplAttribute();

Summary

Constructs a new instance of the MethodImplAttribute class.

See Also

System.Runtime.CompilerServices.MethodImplAttribute Class, System.Runtime.CompilerServices Namespace

MethodImplAttribute.Value Property

public MethodImplOptions Value { get; }

Summary

Gets the MethodImplOptions value describing the method attributed by the current instance.

Property Value

The MethodImplOptions value describing the method attributed by the current instance.

Description

This property is read-only.

See Also

System.Runtime.CompilerServices.MethodImplAttribute Class, System.Runtime.CompilerServices Namespace