IsConstructor Property

MethodBase.IsConstructor Property

 

Gets a value indicating whether the method is a constructor.

Namespace:   System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

[ComVisibleAttribute(true)]
public bool IsConstructor { get; }

Property Value

Type: System.Boolean

true if this method is a constructor represented by a ConstructorInfo object (see note in Remarks about ConstructorBuilder objects); otherwise, false.

System_CAPS_noteNote

The IsConstructor property returns false for a ConstructorBuilder object in a dynamic type, unless the MethodAttributes.RTSpecialName flag was included in the attributes parameter when the constructor was defined. Omitting the RTSpecialName flag does not affect the correctness of the emitted constructor.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft