Table of Contents

Class ValidationMessage

Namespace
Tlumach.Validation
Assembly
Tlumach.dll

One problem found by TranslationValidator.

public sealed class ValidationMessage
Inheritance
ValidationMessage
Inherited Members

Constructors

ValidationMessage(ValidationSeverity, string, string, string?, int, int)

Initializes a new instance of the ValidationMessage class.

public ValidationMessage(ValidationSeverity severity, string code, string message, string? filePath, int line = 0, int column = 0)

Parameters

severity ValidationSeverity

The severity.

code string

The code of the check (one of ValidationCodes).

message string

The text of the message.

filePath string

The full path of the file that the message is about, if any.

line int

The 1-based line in filePath, or 0 when unknown.

column int

The 1-based column in filePath, or 0 when unknown.

Properties

Code

Gets the code of the check (one of ValidationCodes).

public string Code { get; }

Property Value

string

Column

Gets the 1-based column in FilePath, or 0 when the column is unknown.

public int Column { get; }

Property Value

int

FilePath

Gets the full path of the file that the message is about, or null.

public string? FilePath { get; }

Property Value

string

Line

Gets the 1-based line in FilePath, or 0 when the line is unknown.

public int Line { get; }

Property Value

int

Message

Gets the text of the message.

public string Message { get; }

Property Value

string

Severity

Gets the severity.

public ValidationSeverity Severity { get; }

Property Value

ValidationSeverity

Methods

ToString()

Formats the message the way compilers do, which lets Visual Studio and VS Code turn the line in an output window into a link: path(line,column): error CODE: text.

public override string ToString()

Returns

string

The formatted message.