共用方式為


MethodBuilder.IsGenericMethodDefinition 屬性

定義

取得值,指出目前的 MethodBuilder 物件是否代表泛型方法的定義。

public:
 virtual property bool IsGenericMethodDefinition { bool get(); };
public override bool IsGenericMethodDefinition { get; }
member this.IsGenericMethodDefinition : bool
Public Overrides ReadOnly Property IsGenericMethodDefinition As Boolean

屬性值

如果目前的 MethodBuilder 物件代表泛型方法的定義,則為 true,否則為 false

範例

下列程式代碼範例會顯示方法的狀態。 此程式代碼是針對方法提供的較大範例的 DefineGenericParameters 一部分。

// Use the IsGenericMethod property to find out if a
// dynamic method is generic, and IsGenericMethodDefinition
// to find out if it defines a generic method.
Console::WriteLine("Is SampleMethod generic? {0}",
    sampleMethodBuilder->IsGenericMethod);
Console::WriteLine(
    "Is SampleMethod a generic method definition? {0}",
    sampleMethodBuilder->IsGenericMethodDefinition);
// Use the IsGenericMethod property to find out if a
// dynamic method is generic, and IsGenericMethodDefinition
// to find out if it defines a generic method.
Console.WriteLine("Is DemoMethod generic? {0}",
    demoMethod.IsGenericMethod);
Console.WriteLine("Is DemoMethod a generic method definition? {0}",
    demoMethod.IsGenericMethodDefinition);
' Use the IsGenericMethod property to find out if a
' dynamic method is generic, and IsGenericMethodDefinition
' to find out if it defines a generic method.
Console.WriteLine("Is DemoMethod generic? {0}", _
    demoMethod.IsGenericMethod)
Console.WriteLine("Is DemoMethod a generic method definition? {0}", _
    demoMethod.IsGenericMethodDefinition)

備註

MethodBuilder只能用來建立泛型方法定義;它不能用來直接建立建構的泛型方法。 不過,的 MethodBuilder 子類別可能代表建構的泛型方法。

適用於

另請參閱