MethodBuilder.IsGenericMethodDefinition Vlastnost

Definice

Získá hodnotu označující, zda aktuální MethodBuilder objekt představuje definici obecné metody.

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

Hodnota vlastnosti

true pokud aktuální MethodBuilder objekt představuje definici obecné metody, falsev opačném případě .

Příklady

Následující příklad kódu zobrazuje stav metody. Tento kód je součástí většího příkladu, který je k dispozici pro metodu 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)

Poznámky

Objekt a MethodBuilder lze použít pouze k vytvoření definic obecných metod; nelze ho použít k přímému vytvoření vytvořené obecné metody. Podtřída MethodBuilder však může představovat vytvořenou obecnou metodu.

Platí pro

Viz také