MethodBuilder.IsGenericMethodDefinition Tulajdonság

Definíció

Beolvas egy értéket, amely jelzi, hogy az aktuális MethodBuilder objektum egy általános metódus definícióját jelöli-e.

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

Tulajdonság értéke

trueha az aktuális MethodBuilder objektum egy általános metódus definícióját jelöli; ellenkező esetben. false

Példák

Az alábbi példakód egy metódus állapotát mutatja be. Ez a kód a metódushoz DefineGenericParameters megadott nagyobb példa része.

// 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)

Megjegyzések

Az A MethodBuilder csak általános metódusdefiníciók létrehozására használható; nem használható közvetlenül létrehozott általános metódus létrehozásához. Az alosztályok MethodBuilder azonban egy konstruktált általános metódust jelenthetnek.

A következőre érvényes:

Lásd még