ObsoleteAttribute Constructors

Definition

初始化 ObsoleteAttribute 类的新实例。Initializes a new instance of the ObsoleteAttribute class.

Overloads

ObsoleteAttribute()

使用默认属性初始化 ObsoleteAttribute 类的新实例。Initializes a new instance of the ObsoleteAttribute class with default properties.

ObsoleteAttribute(String)

使用指定的变通方法消息初始化 ObsoleteAttribute 类的新实例。Initializes a new instance of the ObsoleteAttribute class with a specified workaround message.

ObsoleteAttribute(String, Boolean)

使用变通方法消息和布尔值初始化 ObsoleteAttribute 类的新实例,该布尔值指示是否将使用已过时的元素视为错误。Initializes a new instance of the ObsoleteAttribute class with a workaround message and a Boolean value indicating whether the obsolete element usage is considered an error.

ObsoleteAttribute()

使用默认属性初始化 ObsoleteAttribute 类的新实例。Initializes a new instance of the ObsoleteAttribute class with default properties.

public:
 ObsoleteAttribute();
public ObsoleteAttribute ();
Public Sub New ()

Remarks

下表显示 ObsoleteAttribute 的实例的初始属性值。The following table shows the initial property values for an instance of ObsoleteAttribute.

PropertyProperty “值”Value
IsError false
Message null

ObsoleteAttribute(String)

使用指定的变通方法消息初始化 ObsoleteAttribute 类的新实例。Initializes a new instance of the ObsoleteAttribute class with a specified workaround message.

public:
 ObsoleteAttribute(System::String ^ message);
public ObsoleteAttribute (string message);
new ObsoleteAttribute : string -> ObsoleteAttribute
Public Sub New (message As String)

Parameters

message
String

描述可选的变通方法的文本字符串。The text string that describes alternative workarounds.

Remarks

下表显示 ObsoleteAttribute 的实例的初始属性值。The following table shows the initial property values for an instance of ObsoleteAttribute.

PropertyProperty “值”Value
IsError falsefalse.
Message 解决方法消息。The workaround message.

ObsoleteAttribute(String, Boolean)

使用变通方法消息和布尔值初始化 ObsoleteAttribute 类的新实例,该布尔值指示是否将使用已过时的元素视为错误。Initializes a new instance of the ObsoleteAttribute class with a workaround message and a Boolean value indicating whether the obsolete element usage is considered an error.

public:
 ObsoleteAttribute(System::String ^ message, bool error);
public ObsoleteAttribute (string message, bool error);
new ObsoleteAttribute : string * bool -> ObsoleteAttribute
Public Sub New (message As String, error As Boolean)

Parameters

message
String

描述可选的变通方法的文本字符串。The text string that describes alternative workarounds.

error
Boolean

如果使用过时的元素生成编译器错误,则为 true;如果生成编译器警告,则为 falsetrue if the obsolete element usage generates a compiler error; false if it generates a compiler warning.

Remarks

下表显示 ObsoleteAttribute 的实例的初始属性值。The following table shows the initial property values for an instance of ObsoleteAttribute.

PropertyProperty “值”Value
IsError error 值。The error value.
Message message 值。The message value.

Applies to