Skip to content
ConsoleMonster
Class

PathField

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Base
Field
Modifiers
sealed

A file or folder path with completion.

Inheritance

Usage

Explore 58 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 28

Constructors

public PathField(string key, string? label = null) #

Creates a path field.

Parameters

key string required
The key.
label string? = null optional
The label.

Properties

public override FieldKind Kind { get; } #

The kind.

public PathKind PathKind { get; set; } #

What is accepted.

public bool MustExist { get; set; } #

Whether the path must exist.

public IList<string> Extensions { get; } #

Extensions offered as suggestions.

Extension Methods

public static PathField Default(PathField pathField, object? value) #

Sets Field.Default: The declared default: the starting value until a value is set, and values equal to it are left out of the equivalent command.

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
value object? required
The value.

Returns

PathField The same instance.

Examples

// C# initializer or property    // C# fluent
pathField.Default = value;       pathField.Default(value);
DependsOn 2 overloads
public static PathField DependsOn(PathField pathField, string item) #

Adds an item to Field.DependsOn: Fields whose change resets this field (and reloads its options).

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
item string required
The item.

Returns

PathField The same instance.
public static PathField DependsOn(PathField pathField, IEnumerable<string> items) #

Adds items to Field.DependsOn: Fields whose change resets this field (and reloads its options).

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
items System.Collections.Generic.IEnumerable<string> required
The items, in order.

Returns

PathField The same instance.
public static PathField Extension(PathField pathField, string item) #

Adds an item to PathField.Extensions: Extensions offered as suggestions.

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
item string required
The item.

Returns

PathField The same instance.
public static PathField Extensions(PathField pathField, IEnumerable<string> items) #

Adds items to PathField.Extensions: Extensions offered as suggestions.

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
items System.Collections.Generic.IEnumerable<string> required
The items, in order.

Returns

PathField The same instance.
public static PathField Help(PathField pathField, string? value) #

Sets Field.Help: Help shown while the field has focus.

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
value string? required
The value.

Returns

PathField The same instance.

Examples

// C# initializer or property    // C# fluent
pathField.Help = value;          pathField.Help(value);
public static PathField Label(PathField pathField, string value) #

Sets Field.Label: The label.

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
value string required
The value.

Returns

PathField The same instance.

Examples

// C# initializer or property    // C# fluent
pathField.Label = value;         pathField.Label(value);
public static PathField MustExist(PathField pathField, bool value = true) #

Sets PathField.MustExist: Whether the path must exist.

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
value bool = true optional
The value; true when omitted.

Returns

PathField The same instance.

Examples

// C# initializer or property    // C# fluent
pathField.MustExist = value;     pathField.MustExist(value);
public static PathField ParameterName(PathField pathField, string? value) #

Sets Field.ParameterName: The command-line parameter this field supplies (Domain, -Domain, --domain); null leaves the field out of the equivalent command.

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
value string? required
The value.

Returns

PathField The same instance.

Examples

// C# initializer or property       // C# fluent
pathField.ParameterName = value;    pathField.ParameterName(value);
public static PathField PathKind(PathField pathField, PathKind value) #

Sets PathField.PathKind: What is accepted.

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
value ConsoleMonster.Interactive.PathKind required
The value.

Returns

PathField The same instance.

Examples

// C# initializer or property    // C# fluent
pathField.PathKind = value;      pathField.PathKind(value);
public static PathField Remember(PathField pathField, bool value = true) #

Sets Field.Remember: Whether the value is kept in presets and remembered choices (never for secrets).

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
value bool = true optional
The value; true when omitted.

Returns

PathField The same instance.

Examples

// C# initializer or property    // C# fluent
pathField.Remember = value;      pathField.Remember(value);
public static PathField Required(PathField pathField, bool value = true) #

Sets Field.Required: Whether an empty value is refused.

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
value bool = true optional
The value; true when omitted.

Returns

PathField The same instance.

Examples

// C# initializer or property    // C# fluent
pathField.Required = value;      pathField.Required(value);
public static PathField ShowWhen(PathField pathField, Func<FormValues, bool>? value) #

Sets Field.VisibleWhen: Shows the field only while this returns true.

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
value System.Func<ConsoleMonster.Interactive.FormValues, bool>? required
The callback.

Returns

PathField The same instance.

Examples

// C# initializer or property     // C# fluent
pathField.VisibleWhen = value;    pathField.ShowWhen(value);
public static PathField Validate(PathField pathField, Func<object?, FormValues, string?>? value) #

Sets Field.Validator: A validator: returns an error message, or null when the value is fine.

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
value System.Func<object?, ConsoleMonster.Interactive.FormValues, string?>? required
The callback.

Returns

PathField The same instance.

Examples

// C# initializer or property    // C# fluent
pathField.Validator = value;     pathField.Validate(value);
public static PathField Value(PathField pathField, object? value) #

Sets Field.Value: The current value.

Parameters

pathField ConsoleMonster.Interactive.PathField required
The instance.
value object? required
The value.

Returns

PathField The same instance.

Examples

// C# initializer or property    // C# fluent
pathField.Value = value;         pathField.Value(value);