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
Public ReadOnly Property IsConstructor As Boolean

属性值

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

实现

属性

注解

备注

IsConstructor 属性返回动态类型中 ConstructorBuilder 对象的 false,除非在定义该构造函数时,attributes 参数中包含 MethodAttributes.RTSpecialName 标志。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.

适用于

另请参阅