MethodBuilder.IsGenericMethodDefinition Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value indicating whether the current MethodBuilder object represents the definition of a generic method.
public:
virtual property bool IsGenericMethodDefinition { bool get(); };
public override bool IsGenericMethodDefinition { get; }
member this.IsGenericMethodDefinition : bool
Public Overrides ReadOnly Property IsGenericMethodDefinition As Boolean
Property Value
true
if the current MethodBuilder object represents the definition of a generic method; otherwise, false
.
Examples
The following code example displays the status of a method. This code is part of a larger example provided for the DefineGenericParameters method.
// 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)
Remarks
A MethodBuilder can only be used to create generic method definitions; it cannot be used to create a constructed generic method directly. However, a subclass of MethodBuilder might represent a constructed generic method.