Class ConfigKeyChangedEventArgs<T>
- Namespace
- MonkeyLoader.Configuration
- Assembly
- MonkeyLoader.dll
Represents the data for the ItemChanged and AnyConfigChanged events.
public sealed class ConfigKeyChangedEventArgs<T> : IConfigKeyChangedEventArgs
Type Parameters
TThe type of the key's value.
- Inheritance
-
ConfigKeyChangedEventArgs<T>
- Implements
- Inherited Members
Constructors
ConfigKeyChangedEventArgs(Config, IDefiningConfigKey<T>, bool, T?, bool, T?, string?, string?, NotifyCollectionChangedEventArgs?)
Creates a new event args instance for a changed config item.
public ConfigKeyChangedEventArgs(Config config, IDefiningConfigKey<T> key, bool hadValue, T? oldValue, bool hasValue, T? newValue, string? label, string? changedProperty, NotifyCollectionChangedEventArgs? changedCollection)
Parameters
configConfigThe config the item belongs to.
keyIDefiningConfigKey<T>The config item that changed.
hadValueboolWhether the config item had a value before the change.
oldValueTThe optional old value.
hasValueboolWhether the config item has a value now.
newValueTThe optional new value.
labelstringA custom label assigned to the change.
changedPropertystringThe name of the changed property on the value.
changedCollectionNotifyCollectionChangedEventArgsThe collection change arguments for the value.
Properties
ChangedCollection
Gets the changed collection event arguments, if this configuration item's changed value originated from an CollectionChanged event.
public NotifyCollectionChangedEventArgs? ChangedCollection { get; }
Property Value
ChangedProperty
Gets the name of the property that changed, if this configuration item's changed value originated from an PropertyChanged event.
public string? ChangedProperty { get; }
Property Value
Config
Gets the Config in which the change occured.
public Config Config { get; }
Property Value
HadValue
Gets whether the old value existed.
public bool HadValue { get; }
Property Value
HasLabel
Gets whether a custom label was set by whoever changed the configuration.
public bool HasLabel { get; }
Property Value
HasValue
Gets whether the new value exists.
public bool HasValue { get; }
Property Value
IsChangedCollection
Gets whether this configuration item's changed value originated from an CollectionChanged event.
public bool IsChangedCollection { get; }
Property Value
- bool
trueif ChangedCollection is notnull; otherwise,false.
IsChangedProperty
Gets whether this configuration item's changed value originated from an PropertyChanged event.
public bool IsChangedProperty { get; }
Property Value
- bool
trueif ChangedProperty is notnull; otherwise,false.
Key
Gets the configuration item who's value changed.
public IDefiningConfigKey<T> Key { get; }
Property Value
Label
Gets a custom label that may be set by whoever changed the configuration.
public string? Label { get; }
Property Value
NewValue
Gets the new value of the DefiningConfigKey<T>.
This can be the default value.
public T? NewValue { get; }
Property Value
- T
OldValue
Gets the old value of the DefiningConfigKey<T>.
This can be the default value.
public T? OldValue { get; }
Property Value
- T