LaunchBoxContributors
On this page

PluginConfigurationValues14.1

Class in Unbroken.LaunchBox.Plugins.Capabilities.Configuration

C#
public sealed class PluginConfigurationValues
Explicit 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

C#
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

C#
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

C#
public PluginConfigurationValues Copy()
Creates an independent snapshot, including all scope overrides.

Returns

A copy that can be edited without changing this snapshot.

GetValue

C#
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

C#
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

C#
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

C#
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

C#
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.