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
idstringThe mod-unique identifier of the config item. Must not be null or whitespace.
Exceptions
- ArgumentNullException
If the
idis 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
EqualityComparer
Gets the custom IEqualityComparer<T> for IConfigKeys.
public static readonly IEqualityComparer<IConfigKey> EqualityComparer
Field Value
PropertyChangedEventLabel
The event label used when a config item's value triggered an PropertyChanged event.
public const string PropertyChangedEventLabel = "PropertyChanged"
Field Value
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
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
Properties
Id
Gets the mod-unique identifier for the wanted config item.
public string Id { get; }
Property Value
IsDefiningKey
Gets whether this instance defines the config item with this name.
public bool IsDefiningKey { get; }
Property Value
Methods
Equals(IConfigKey?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(IConfigKey? other)
Parameters
otherIConfigKeyAn object to compare with this object.
Returns
- bool
true if the current object is equal to the
otherparameter; otherwise, false.
Equals(object?)
Checks if the given object can be considered equal to this one.
public override bool Equals(object? obj)
Parameters
objobjectThe other object.
Returns
- bool
trueif the other object is considered equal.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Operators
operator ==(ConfigKey?, ConfigKey?)
Checks if two ConfigKeys are equal.
public static bool operator ==(ConfigKey? left, ConfigKey? right)
Parameters
Returns
- bool
trueif 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
idstringThe mod-unique identifier of the config item.
Returns
operator !=(ConfigKey?, ConfigKey?)
Checks if two ConfigKeys are unequal.
public static bool operator !=(ConfigKey? left, ConfigKey? right)
Parameters
Returns
- bool
trueif they're considered unequal.