Class SettingsEditor
Edits options for the settings window: changes are kept here, then applied to the running program or saved to the settings file, through an ISettingsStore.
Inheritance
SettingsEditor
Namespace: Uniform.Matrix.Hosting
Assembly: Uniform.Matrix.Hosting.dll
public sealed class SettingsEditor
Constructors
|
Edit this page
View Source
Edit options stored in store.
Declaration
public SettingsEditor(ISettingsStore store, IReadOnlyList<OptionInfo> options)
Parameters
Properties
|
Edit this page
View Source
Whether there are changes not saved to the settings file.
Declaration
public bool HasUnsavedChanges { get; }
Property Value
|
Edit this page
View Source
All options, in display order.
Declaration
public IReadOnlyList<OptionInfo> Options { get; }
Property Value
|
Edit this page
View Source
Declaration
public string SettingsPath { get; }
Property Value
Methods
|
Edit this page
View Source
Apply edits to the running client; return the keys among them that need a restart.
Declaration
public IReadOnlyList<string> Apply()
Returns
|
Edit this page
View Source
Discard edits that are not applied yet.
Declaration
public void DiscardEdits()
|
Edit this page
View Source
Write the current values that differ from the defaults to another file, e.g. to keep a copy; secrets are left out.
Declaration
public void Export(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
|
|
Edit this page
View Source
Return whether option is edited or applied but not saved.
Declaration
public OptionChange GetChange(OptionInfo option)
Parameters
Returns
|
Edit this page
View Source
Return the value as shown in the list: secrets hidden, unset as (not set).
Declaration
public string GetDisplayValue(OptionInfo option)
Parameters
Returns
|
Edit this page
View Source
Return which layer sets the option, or edited for pending changes.
Declaration
public string GetSource(OptionInfo option)
Parameters
Returns
|
Edit this page
View Source
Return the value shown for option: the edit, else the current value, else the default; null when unset.
Declaration
public string? GetValue(OptionInfo option)
Parameters
Returns
|
Edit this page
View Source
Load the known options of a settings file as edits; return how many were loaded.
Declaration
public int Load(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
|
Returns
|
Edit this page
View Source
Undo the latest unsaved step of option: discards an edit, else undo an applied change, else mark it for removal from the settings file on save, so the built-in default or appsettings.json applies.
Declaration
public OptionChange Reset(OptionInfo option)
Parameters
Returns
|
Edit this page
View Source
Save all edited and applied changes to the settings file, which also applies them; return the keys among them that need a restart.
Declaration
public IReadOnlyList<string> Save()
Returns
|
Edit this page
View Source
Set option from text; return an error message when the text is not a valid value.
Declaration
public string? Set(OptionInfo option, string text)
Parameters
Returns