MethodBase.IsConstructor 属性

定义

获取一个值,该值指示此方法是否为构造函数。Gets a value indicating whether the method is a constructor.

public:
 property bool IsConstructor { bool get(); };
public bool IsConstructor { get; }
[System.Runtime.InteropServices.ComVisible(true)]
public bool IsConstructor { get; }
member this.IsConstructor : bool
[<System.Runtime.InteropServices.ComVisible(true)>]
member this.IsConstructor : bool
Public ReadOnly Property IsConstructor As Boolean

属性值

Boolean

如果此方法是 ConstructorInfo 对象(参见"备注"中有关 ConstructorBuilder 对象的说明)所表示的构造函数,则为 true;否则为 falsetrue if this method is a constructor represented by a ConstructorInfo object (see note in Remarks about ConstructorBuilder objects); otherwise, false.

实现

属性

注解

备注

IsConstructor属性 falseConstructorBuilder 动态类型中的对象返回,除非在 MethodAttributes.RTSpecialName 定义构造函数时,该标志包含在 attributes 参数中。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. 省略 RTSpecialName 标志不会影响发出的构造函数的正确性。Omitting the RTSpecialName flag does not affect the correctness of the emitted constructor.

适用于

另请参阅