MethodBuilder.IsGenericMethod Tulajdonság

Definíció

Egy értéket kap, amely jelzi, hogy a metódus általános metódus-e.

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

Tulajdonság értéke

trueha a módszer általános; egyéb 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

A metódus általános, ha típusparaméterekkel rendelkezik. A metódust általánossá teheti, ha meghívja a DefineGenericParameters metódust a típusparaméterek hozzáadásához. Ez a módosítás nem vonható vissza.

A következőre érvényes:

Lásd még