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(vbCrLf & "Method Attributes: {0}", _
    hello.Attributes)

備註

目前,動態方法的方法屬性總是 PublicStatic

適用於