Class ConfigEntryBase

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

Inheritance
System.Object ConfigEntryBase ConfigEntry<T>
Inherited Members
System.Object.ToString() System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) System.Object.GetHashCode() System.Object.GetType() System.Object.MemberwiseClone()
Namespace: BepInEx.Configuration
Assembly: BepInEx.Core.dll
Syntax
public abstract class ConfigEntryBase

Constructors

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

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

Declaration
protected ConfigEntryBase(ConfigFile configFile, ConfigDefinition definition, Type settingType, object defaultValue, ConfigDescription configDescription)
Parameters
Type Name Description
ConfigFile configFile
ConfigDefinition definition
System.Type settingType
System.Object defaultValue
ConfigDescription configDescription

Properties

BoxedValue

Get or set the value of the setting.

Declaration
public abstract object BoxedValue { get; set; }
Property Value
Type Description
System.Object

ConfigFile

Config file this entry is a part of.

Declaration
public ConfigFile ConfigFile { get; }
Property Value
Type Description
ConfigFile

DefaultValue

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

Declaration
public object DefaultValue { get; }
Property Value
Type Description
System.Object

Definition

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

Declaration
public ConfigDefinition Definition { get; }
Property Value
Type Description
ConfigDefinition

Description

Description / metadata of this setting.

Declaration
public ConfigDescription Description { get; }
Property Value
Type Description
ConfigDescription

SettingType

Type of the BoxedValue that this setting holds.

Declaration
public Type SettingType { get; }
Property Value
Type Description
System.Type

Methods

ClampValue<T>(T)

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

Declaration
protected T ClampValue<T>(T value)
Parameters
Type Name Description
T value
Returns
Type Description
T
Type Parameters
Name Description
T

GetSerializedValue()

Get the serialized representation of the value.

Declaration
public string GetSerializedValue()
Returns
Type Description
System.String

OnSettingChanged(Object)

Trigger setting changed event.

Declaration
protected void OnSettingChanged(object sender)
Parameters
Type Name Description
System.Object sender

SetSerializedValue(String)

Set the value by using its serialized form.

Declaration
public void SetSerializedValue(string value)
Parameters
Type Name Description
System.String value

WriteDescription(StreamWriter)

Write a description of this setting using all available metadata.

Declaration
public void WriteDescription(StreamWriter writer)
Parameters
Type Name Description
System.IO.StreamWriter writer