DynamicMethod.Attributes 属性

定义

创建动态方法后获取指定的属性。

public:
 virtual property System::Reflection::MethodAttributes Attributes { System::Reflection::MethodAttributes get(); };
public override System.Reflection.MethodAttributes Attributes { get; }
member this.Attributes : System.Reflection.MethodAttributes
Public Overrides ReadOnly Property Attributes As MethodAttributes

属性值

表示此方法的属性的 MethodAttributes 的值的按位组合。

示例

下面的代码示例显示动态方法的方法属性。 此代码示例是为 DynamicMethod 类提供的一个更大示例的一部分。

// Display MethodAttributes for the dynamic method, set when 
// the dynamic method was created.
Console::WriteLine("\r\nMethod Attributes: {0}", hello->Attributes);
// Display MethodAttributes for the dynamic method, set when
// the dynamic method was created.
Console.WriteLine("\r\nMethod Attributes: {0}", hello.Attributes);
' Display MethodAttributes for the dynamic method, set when 
' the dynamic method was created.
Console.WriteLine(vbCrLf & "Method Attributes: {0}", _
    hello.Attributes)

注解

目前,动态方法的方法属性始终 Public 为 和 Static

适用于