Skip to content
ConsoleMonster
Class

FormValues

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Implements
IEnumerable<KeyValuePair<string, object>> IEnumerable
Modifiers
sealed
Attributes
DefaultMember("Item")

The values of a form by field name: typed access (FormValues.Get), multi-selections as lists, and only the fields that are visible in FormValues.Visible.

Inheritance

  • object
  • FormValues

Usage

Explore 54 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 33

Constructors

public FormValues() #

Methods

public bool Contains(string name) #

Whether a field exists.

Parameters

name string required
The field name.

Returns

bool True when it exists.
public IEnumerator<KeyValuePair<string, object?>> GetEnumerator() #

Returns an enumerator that iterates through the collection.

Returns

IEnumerator<KeyValuePair<string, object?>> An enumerator that can be used to iterate through the collection.
public IReadOnlyList<TItem?> GetList<TItem>(string name) #

A multi-selection (or a single value) as a typed list.

Type Parameters

TItem
The item type.

Parameters

name string required
The field name.

Returns

IReadOnlyList<TItem?> The items that have the type.
public T? Get<T>(string name, T? fallback = null) #

The value converted to T (lists for multi-selections), or the default.

Type Parameters

T
The type.

Parameters

name string required
The field name.
fallback T? = null optional
Returned when the field is empty.

Returns

T? The value.
public bool IsVisible(string name) #

Whether a field is currently shown (its condition holds).

Parameters

name string required
The field name.

Returns

bool True when visible.
public Dictionary<string, object?> ToDictionary() #

A plain dictionary of the visible values.

Returns

Dictionary<string, object?> The dictionary.

Properties

public object? this[string name] { get; } #

The value of a field, or null.

Parameters

name string required
The field name.
public IReadOnlyCollection<string> Visible { get; } #

The names of the visible fields.