DiagnosticDescriptor Class

Describes a diagnostic definition: its id, title, message template, and default severity.

public sealed class DiagnosticDescriptor

Example

var descriptor = new DiagnosticDescriptor("XML0001", "Missing end tag", "Missing end tag for '{0}'.", DiagnosticSeverity.Error);

// Create a diagnostic from the descriptor: the arguments fill the message template
var diagnostic = Diagnostic.Create(descriptor, Location.None, "root");
Assert.Equal("XML0001", diagnostic.Id);
Assert.Equal("Missing end tag for 'root'.", diagnostic.Message);
Assert.Equal(DiagnosticSeverity.Error, diagnostic.Severity);

Constructors

NameDescription
DiagnosticDescriptor(string, string, string, DiagnosticSeverity)

DiagnosticDescriptor(string, string, string, DiagnosticSeverity)

DiagnosticDescriptor.cs
public DiagnosticDescriptor(string id, string title, string messageFormat, DiagnosticSeverity defaultSeverity)

Parameters

id string
title string
messageFormat string
defaultSeverity DiagnosticSeverity

No documentation is available.

Properties

NameDescription
DefaultSeverity
Id
MessageFormat
Title
public DiagnosticSeverity DefaultSeverity { get; }

Property value

DiagnosticSeverity

No documentation is available.

public string Id { get; }

Property value

string

No documentation is available.

public string MessageFormat { get; }

Property value

string

No documentation is available.

public string Title { get; }

Property value

string

No documentation is available.