API Reference
Class
ChoiceStore
Per-app storage of named presets and (opt-in) remembered choices, in %APPDATA%\ConsoleMonster\<app>\ on Windows and $XDG_CONFIG_HOME/ConsoleMonster/<app>/ (or ~/.config) elsewhere. Values are plain JSON (strings, booleans and lists); secrets are never stored.
Inheritance
- Object
- ChoiceStore
Constructors
public ChoiceStore(String appName, String? root = null) #Creates a store for an app.
Parameters
- appName System.String
- The app name (a folder name; unsafe characters are replaced).
- root System.String? = null
- The folder that holds every app's folder; null uses the per-user default.
Methods
public static String DefaultRoot() #Returns:
StringThe per-user root: the roaming AppData folder on Windows, the XDG config folder elsewhere.
Returns
The folder.
public Boolean DeletePreset(String form, String name) #Returns:
BooleanDeletes a preset.
Parameters
- form System.String
- The form key.
- name System.String
- The preset name.
Returns
Whether it existed.
public IDictionary<String, Object?>? LoadLast(String form) #Returns:
IDictionary<String, Object?>?Loads the remembered choices of a form.
Parameters
- form System.String
- The form key.
Returns
The values, or null.
public IDictionary<String, Object?>? LoadPreset(String form, String name) #Returns:
IDictionary<String, Object?>?Loads a preset.
Parameters
- form System.String
- The form key.
- name System.String
- The preset name.
Returns
The values, or null.
public IReadOnlyList<String> PresetNames(String form) #Returns:
IReadOnlyList<String>The preset names saved for a form.
Parameters
- form System.String
- The form key (its title by default).
Returns
The names, sorted.
public Void SaveLast(String form, IDictionary<String, Object?> values) #Returns:
VoidRemembers the choices of a form.
Parameters
- form System.String
- The form key.
- values System.Collections.Generic.IDictionary<System.String, System.Object?>
- The values.
public Void SavePreset(String form, String name, IDictionary<String, Object?> values) #Returns:
VoidSaves a preset (replacing one with the same name).
Parameters
- form System.String
- The form key.
- name System.String
- The preset name.
- values System.Collections.Generic.IDictionary<System.String, System.Object?>
- The values (strings, booleans, lists of strings).
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?