PluginConfigurationValues14.1
Class in Unbroken.LaunchBox.Plugins.Capabilities.Configuration
public sealed class PluginConfigurationValuesExplicit configuration values for a plugin instance, including optional named scopes.
Remarks
Editing these values does not persist them. An empty scope is the base scope; named scopes inherit missing values from it. Names and field identifiers are compared without regard to case.Constructors
PluginConfigurationValues
public PluginConfigurationValues()A summary has not been written for this member.
Properties
ScopesGets the stored scope names. An empty name denotes the base scope.
Scopes
public IEnumerable<string> Scopes { get; }Gets the stored scope names. An empty name denotes the base scope.
Methods
CopyCreates an independent snapshot, including all scope overrides.GetValueReads a setting, optionally inheriting from the base scope.GetValuesGets the explicit values in one scope, without inherited values.HasValueReports whether the specified scope explicitly stores a setting.ResolveCreates a view of one scope with optional form defaults for typed reads.SetValueSets a value in this snapshot. Null or empty values remove the override.
Copy
public PluginConfigurationValues Copy()Creates an independent snapshot, including all scope overrides.
Returns
A copy that can be edited without changing this snapshot.GetValue
public string GetValue(
string key,
string? scopeName = null,
bool inherit = true
)Reads a setting, optionally inheriting from the base scope.
key- The form field identifier.
scopeName- The scope name, or null for the base scope.
inherit- Whether a missing scope override inherits the base scope value.
Returns
The stored value, or an empty string when unset.GetValues
public IEnumerable<KeyValuePair<string, string>> GetValues(
string? scopeName = null
)Gets the explicit values in one scope, without inherited values.
scopeName- The scope name, or null for the base scope.
Returns
The scope's field identifiers and values.HasValue
public bool HasValue(string key, string? scopeName = null)Reports whether the specified scope explicitly stores a setting.
key- The form field identifier.
scopeName- The scope name, or null for the base scope.
Returns
True when the scope has its own nonempty value.Resolve
public IPluginConfigurationValues Resolve(
string? scopeName = null,
PluginFormDefinition? defaults = null
)Creates a view of one scope with optional form defaults for typed reads.
scopeName- The scope, or null for the base scope.
defaults- The form declaring field defaults, or null for runtime reads.
Returns
A view of this snapshot. Edits affect this snapshot only.SetValue
public void SetValue(string key, string? value, string? scopeName = null)Sets a value in this snapshot. Null or empty values remove the override.
key- The form field identifier. Blank keys are ignored.
value- The value to store, or null to clear it.
scopeName- The scope name, or null for the base scope.