MethodBuilder.IsGenericMethod 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 method is a generic method.
public:
virtual property bool IsGenericMethod { bool get(); };
public override bool IsGenericMethod { get; }
member this.IsGenericMethod : bool
Public Overrides ReadOnly Property IsGenericMethod As Boolean
Property Value
true
if the method is generic; 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 method is generic if it has type parameters. You can make a method generic by calling the DefineGenericParameters method to add type parameters. This change cannot be reversed.
Applies to
See also
Povratne informacije
https://aka.ms/ContentUserFeedback.
Kmalu na voljo: V letu 2024 bomo ukinili storitev Težave v storitvi GitHub kot mehanizem za povratne informacije za vsebino in jo zamenjali z novim sistemom za povratne informacije. Za več informacij si oglejte:Pošlji in prikaži povratne informacije za