Docs · API reference · Verso.Abstractions

ParameterDefinition Class#

Defines a parameter accepted by a magic command.

public sealed record ParameterDefinition : System.IEquatable<Verso.Abstractions.ParameterDefinition>

Inheritance System.Object → ParameterDefinition

Implements System.IEquatable<ParameterDefinition>

Constructors#

ParameterDefinition(string, string, Type, bool, object) Constructor#

Defines a parameter accepted by a magic command.

public ParameterDefinition(string Name, string Description, System.Type ParameterType, bool IsRequired=false, object? DefaultValue=null);

Parameters#

Name System.String

The parameter name as it appears in command usage (e.g. "timeout").

Description System.String

A human-readable description of the parameter's purpose.

ParameterType System.Type

The CLR type expected for the parameter value.

IsRequired System.Boolean

Indicates whether the parameter must be supplied. Defaults to false.

DefaultValue System.Object

The default value used when the parameter is not supplied. Defaults to null.

Properties#

DefaultValue Property#

The default value used when the parameter is not supplied. Defaults to null.

public object? DefaultValue { get; init; }

Property Value#

System.Object

Description Property#

A human-readable description of the parameter's purpose.

public string Description { get; init; }

Property Value#

System.String

IsRequired Property#

Indicates whether the parameter must be supplied. Defaults to false.

public bool IsRequired { get; init; }

Property Value#

System.Boolean

Name Property#

The parameter name as it appears in command usage (e.g. "timeout").

public string Name { get; init; }

Property Value#

System.String

ParameterType Property#

The CLR type expected for the parameter value.

public System.Type ParameterType { get; init; }

Property Value#

System.Type