Metalama 1.0 / / Metalama Documentation / Aspect API / Metalama.​Framework.​Diagnostics / Diagnostic­Definition<T>

Class DiagnosticDefinition<T>

Defines a diagnostic with a strongly-typed set of parameters that are typically specified by using a named tuple for generic parameter T. For diagnostics that accept a single parameter, T must be set to the type of this parameter. To accept several parameters, use a tuple. For a diagnostic that does not accept parameters, use DiagnosticDefinition.

Inheritance
DiagnosticDefinition<T>
Namespace: Metalama.Framework.Diagnostics
Assembly: Metalama.Framework.dll
Syntax
public class DiagnosticDefinition<T> : Object, IDiagnosticDefinition
Type Parameters
Name Description
T

Type of arguments: a single type if there is a single argument, or a named tuple type for several arguments Alternatively, you can also use object[].

Constructors

Name Description
DiagnosticDefinition(String, Severity, String, String, String)

Initializes a new instance of the DiagnosticDefinition<T> class.

Properties

Name Description
Category

Gets the category of the diagnostic (e.g. your product name).

Id

Gets an unique identifier for the diagnostic (e.g. MY001).

MessageFormat

Gets the formatting string of the diagnostic message.

Severity

Gets the severity of the diagnostic.

Title

Gets a short title describing the diagnostic. This title is typically described in the solution explorer of the IDE and does not contain formatting string parameters.

Methods

Name Description
ToString()
WithArguments(T)

Creates an instance of the current diagnostic definition with specific arguments.

See Also