編集

次の方法で共有


ObsoleteAttribute Constructors

Definition

Initializes a new instance of the ObsoleteAttribute class.

Overloads

ObsoleteAttribute()

Initializes a new instance of the ObsoleteAttribute class with default properties.

ObsoleteAttribute(String)

Initializes a new instance of the ObsoleteAttribute class with a specified workaround message.

ObsoleteAttribute(String, Boolean)

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()

Source:
ObsoleteAttribute.cs
Source:
ObsoleteAttribute.cs
Source:
ObsoleteAttribute.cs

Initializes a new instance of the ObsoleteAttribute class with default properties.

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

Remarks

The following table shows the initial property values for an instance of ObsoleteAttribute.

Property Value
IsError false
Message null
DiagnosticId null
UrlFormat null

Applies to

ObsoleteAttribute(String)

Source:
ObsoleteAttribute.cs
Source:
ObsoleteAttribute.cs
Source:
ObsoleteAttribute.cs

Initializes a new instance of the ObsoleteAttribute class with a specified workaround message.

public:
 ObsoleteAttribute(System::String ^ message);
public ObsoleteAttribute (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

The following table shows the initial property values for an instance of ObsoleteAttribute.

Property Value
IsError false.
Message The workaround message.
DiagnosticId null.
UrlFormat null.

Applies to

ObsoleteAttribute(String, Boolean)

Source:
ObsoleteAttribute.cs
Source:
ObsoleteAttribute.cs
Source:
ObsoleteAttribute.cs

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);
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 if the obsolete element usage generates a compiler error; false if it generates a compiler warning.

Remarks

The following table shows the initial property values for an instance of ObsoleteAttribute.

Property Value
IsError The error value.
Message The message value.
DiagnosticId null.
UrlFormat null.

Applies to