FormPreset
ConsoleMonster.Interactive
A preset a form comes with (Form.Presets): a name and field values. It is listed before the presets people save, marked as built in, and cannot be overwritten or deleted; applying it sets the fields the way a saved preset does.
Inheritance
- object
- FormPreset
Usage
Explore 15 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.
Returned or exposed by 6
- Property Form.Presets
- Extension method FormPreset.Description
- Extension method FormPreset.Preview
- Method FormPreset.Value
- Method FormPresetFluent.Description
- Method FormPresetFluent.Preview
Accepted by parameters 9
- Extension method Form.Preset
- Extension method Form.Presets
- Method Form.Preset
- Method FormFluent.Preset
- Method FormFluent.Presets
- Extension method FormPreset.Description
- Extension method FormPreset.Preview
- Method FormPresetFluent.Description
- Method FormPresetFluent.Preview
Constructors
public FormPreset(string name, IDictionary<string, object?> values) #Creates a built-in preset.
Parameters
- name string
- The name; a saved preset cannot take it.
- values System.Collections.Generic.IDictionary<string, object?>
- Field values by field name (ignoring case), as the fields take them: a string, a number, a bool, or a list for a multi-choice field.
Methods
public override string ToString() #Returns a string that represents the current object.
Returns
string A string that represents the current object.public FormPreset Value(string field, object? value) #Sets a field's value.
Parameters
- field string
- The field name (ignoring case).
- value object?
- The value, as the field takes it: a string, a number, a bool, or a list for a multi-choice field.
Inherited Methods
Properties
public string? Description { get; set; } #A sentence about the preset, shown with it, or null.
public IDictionary<string, object?> Values { get; } #The field values by field name (ignoring case).
public IWidget? Preview { get; set; } #Content describing the preset (what it fills in), for lists that show a preview while a preset has focus; the command palette, where a form's presets are listed today, shows the FormPreset.Description only.
Extension Methods
public static FormPreset Description(FormPreset formPreset, string? value) #Sets FormPreset.Description: A sentence about the preset, shown with it, or null.
Parameters
- formPreset ConsoleMonster.Interactive.FormPreset
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
formPreset.Description = value; formPreset.Description(value);public static FormPreset Preview(FormPreset formPreset, IWidget? value) #Sets FormPreset.Preview: Content describing the preset (what it fills in), for lists that show a preview while a preset has focus; the command palette, where a form's presets are listed today, shows the FormPreset.Description only.
Parameters
- formPreset ConsoleMonster.Interactive.FormPreset
- The instance.
- value ConsoleMonster.Layout.IWidget?
- The value.
Examples
// C# initializer or property // C# fluent
formPreset.Preview = value; formPreset.Preview(value);