LaunchBoxContributors
On this page

IPluginConfigurationValues14.1

Interface in Unbroken.LaunchBox.Plugins.Capabilities.Configuration

C#
public interface IPluginConfigurationValues
Reads effective values for one configuration scope, with optional declared field defaults.

Remarks

Typed accessors use invariant formatting. Empty or absent values inherit from the base scope, then the declared default, then the caller's default. TryGetValue excludes declared defaults. Editing these values never persists them.

Methods

  • GetBooleanReads a Boolean with fallback when the value cannot be parsed.
  • GetInt32Reads an invariant integer with fallback when the value cannot be parsed.
  • GetStringReads a string with fallback to the declared and caller defaults.
  • SetValueUpdates this scope in the detached snapshot. Null or empty removes its override.
  • TryGetValueLooks up an explicitly supplied or inherited value, excluding declared defaults.

GetBoolean

C#
bool GetBoolean(string key, bool defaultValue = false)
Reads a Boolean with fallback when the value cannot be parsed.
key
The field identifier.
defaultValue
The fallback when neither a value nor declared default can be parsed.

Returns

The effective Boolean.

GetInt32

C#
int GetInt32(string key, int defaultValue = 0)
Reads an invariant integer with fallback when the value cannot be parsed.
key
The field identifier.
defaultValue
The fallback when neither a value nor declared default can be parsed.

Returns

The effective integer.

GetString

C#
string GetString(string key, string defaultValue = "")
Reads a string with fallback to the declared and caller defaults.
key
The field identifier.
defaultValue
The fallback when no value or declared default exists.

Returns

The effective string.

SetValue

C#
void SetValue(string key, string? value)
Updates this scope in the detached snapshot. Null or empty removes its override.
key
The field identifier.
value
The invariant value, or null to clear it.

TryGetValue

C#
bool TryGetValue(string key, out string value)
Looks up an explicitly supplied or inherited value, excluding declared defaults.
key
The field identifier.
value
The value, or an empty string when absent.

Returns

Whether a nonempty value exists.