Table of Contents

Class ConfigKey

Namespace
MonkeyLoader.Configuration
Assembly
MonkeyLoader.dll

Represents a identifier-only config item, which can be used to get or set the values of defining keys with the same Id.

public class ConfigKey : IConfigKey, IEquatable<IConfigKey>, IIdentifiable
Inheritance
ConfigKey
Implements
Derived
Inherited Members
Extension Methods

Constructors

ConfigKey(string)

Creates a new identifier-only config item with the given id.

public ConfigKey(string id)

Parameters

id string

The mod-unique identifier of the config item. Must not be null or whitespace.

Exceptions

ArgumentNullException

If the id is null or whitespace.

Fields

CollectionChangedEventLabel

The event label used when a config item's value triggered an CollectionChanged event.

public const string CollectionChangedEventLabel = "CollectionChanged"

Field Value

string

EqualityComparer

Gets the custom IEqualityComparer<T> for IConfigKeys.

public static readonly IEqualityComparer<IConfigKey> EqualityComparer

Field Value

IEqualityComparer<IConfigKey>

PropertyChangedEventLabel

The event label used when a config item's value triggered an PropertyChanged event.

public const string PropertyChangedEventLabel = "PropertyChanged"

Field Value

string

SetFromDefaultEventLabel

The event label used when a config item's value is set from getting the computed default.

public const string SetFromDefaultEventLabel = "Default"

Field Value

string

SetFromLoadEventLabel

The event label used when a config item's value is set from getting loaded from a saved config.

public const string SetFromLoadEventLabel = "Load"

Field Value

string

Properties

Id

Gets the mod-unique identifier for the wanted config item.

public string Id { get; }

Property Value

string

IsDefiningKey

Gets whether this instance defines the config item with this name.

public bool IsDefiningKey { get; }

Property Value

bool

Methods

Equals(IConfigKey?)

public bool Equals(IConfigKey? other)

Parameters

other IConfigKey

Returns

bool

Equals(object?)

Checks if the given object can be considered equal to this one.

public override bool Equals(object? obj)

Parameters

obj object

The other object.

Returns

bool

true if the other object is considered equal.

GetHashCode()

public override int GetHashCode()

Returns

int

Operators

operator ==(ConfigKey?, ConfigKey?)

Checks if two ConfigKeys are equal.

public static bool operator ==(ConfigKey? left, ConfigKey? right)

Parameters

left ConfigKey

The first key.

right ConfigKey

The second key.

Returns

bool

true if they're considered equal.

implicit operator ConfigKey(string)

Creates a new ConfigKey instance from the given name.

public static implicit operator ConfigKey(string id)

Parameters

id string

The mod-unique identifier of the config item.

Returns

ConfigKey

operator !=(ConfigKey?, ConfigKey?)

Checks if two ConfigKeys are unequal.

public static bool operator !=(ConfigKey? left, ConfigKey? right)

Parameters

left ConfigKey

The first key.

right ConfigKey

The second key.

Returns

bool

true if they're considered unequal.