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

Значение свойства

Значение true, если текущий объект MethodBuilder представляет определение универсального метода; в противном случае — значение 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 может представлять сконструированный универсальный метод.

Применяется к

См. также раздел