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

適用於