Skip to content

InputValidationResult

Returns the outcome of an input check without executing a command.

public sealed class InputValidationResult

InputValidationResult(InputValidationState, IReadOnlyList<InputDiagnostic>?)

Section titled “InputValidationResult(InputValidationState, IReadOnlyList<InputDiagnostic>?)”

Creates a result with optional diagnostics.

public InputValidationResult(InputValidationState state, IReadOnlyList<InputDiagnostic>? diagnostics = null)
  • state (InputValidationState): Overall validation state.
  • diagnostics (IReadOnlyList<InputDiagnostic>): Messages from the check.

Reports that more input or another check is needed.

public static InputValidationResult Incomplete(string message, InputSourceRange? range = null)

InputValidationResult

Rejects input with a diagnostic.

public static InputValidationResult Invalid(string message, InputSourceRange? range = null)

InputValidationResult

Returns successful validation.

public static InputValidationResult Valid()

InputValidationResult

Gets the messages returned by the check.

public IReadOnlyList<InputDiagnostic> Diagnostics { get; }

IReadOnlyList<InputDiagnostic>

Gets the overall state, including any more severe diagnostic.

public InputValidationState State { get; }

InputValidationState