Skip to content

ConfigEntryBase Class

Container for a single setting of a ConfigFile. Each config entry is linked to one config file.

C#
public abstract class ConfigEntryBase

Inheritance object

ConfigEntryBase(ConfigFile, ConfigDefinition, Type, object, ConfigDescription)

Section titled “ConfigEntryBase(ConfigFile, ConfigDefinition, Type, object, ConfigDescription)”

Types of defaultValue and definition.AcceptableValues have to be the same as settingType.

C#
protected ConfigEntryBase(ConfigFile configFile, ConfigDefinition definition, Type settingType, object defaultValue, ConfigDescription configDescription)

configFile ConfigFile

definition ConfigDefinition

settingType Type

defaultValue object

configDescription ConfigDescription

Config file this entry is a part of.

C#
public ConfigFile ConfigFile { get; }

Category and name of this setting. Used as a unique key for identification within a ConfigFile.

C#
public ConfigDefinition Definition { get; }

Description / metadata of this setting.

C#
public ConfigDescription Description { get; }

Type of the BoxedValue that this setting holds.

C#
public Type SettingType { get; }

Default value of this setting (set only if the setting was not changed before).

C#
public object DefaultValue { get; }

Get or set the value of the setting.

C#
public abstract object BoxedValue { get; set; }

Get the serialized representation of the value.

C#
public string GetSerializedValue()

string

Set the value by using its serialized form.

C#
public void SetSerializedValue(string value)

value string

If necessary, clamp the value to acceptable value range. T has to be equal to settingType.

C#
protected T ClampValue<T>(T value)

value T

T

Trigger setting changed event.

C#
protected void OnSettingChanged(object sender)

sender object

Write a description of this setting using all available metadata.

C#
public void WriteDescription(StreamWriter writer)

writer StreamWriter