Open sandboxFocus

Constructor DiagnosticDefinition

DiagnosticDefinition(string, Severity, string, string?, string?)

Initializes a new instance of the DiagnosticDefinition class.

Declaration
public DiagnosticDefinition(string id, Severity severity, string messageFormat, string? title = null, string? category = null)
Parameters
Type Name Description
string id

An unique identifier for the diagnostic (e.g. MY001).

Severity severity

The severity of the diagnostic.

string messageFormat

The formatting string of the diagnostic message.

string title

An optional short title for the diagnostic. If no value is provided for this parameter, messageFormat is used.

string category

An optional category to which this diagnostic belong. The default value is Metalama.User.

DiagnosticDefinition(string, Severity, string, string?, string?, string?)

Initializes a new instance of the DiagnosticDefinition class and specifies the URL of the documentation page of the diagnostic.

Declaration
public DiagnosticDefinition(string id, Severity severity, string messageFormat, string? title, string? category, string? helpLinkUri)
Parameters
Type Name Description
string id

An unique identifier for the diagnostic (e.g. MY001).

Severity severity

The severity of the diagnostic.

string messageFormat

The formatting string of the diagnostic message.

string title

A short title for the diagnostic. If the value is null, messageFormat is used.

string category

The category to which this diagnostic belong. If the value is null, Metalama.User is used.

string helpLinkUri

The URL of the documentation page of the diagnostic, or null. If the URL contains the {0} placeholder, the placeholder is replaced by the lower-case value of id. For instance, https://example.com/errors/{0} becomes https://example.com/errors/my001.