Table of Contents

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

T

The 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

config Config

The config the item belongs to.

key IDefiningConfigKey<T>

The config item that changed.

hadValue bool

Whether the config item had a value before the change.

oldValue T

The optional old value.

hasValue bool

Whether the config item has a value now.

newValue T

The optional new value.

label string

A custom label assigned to the change.

changedProperty string

The name of the changed property on the value.

changedCollection NotifyCollectionChangedEventArgs

The 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

NotifyCollectionChangedEventArgs

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

string

Config

Gets the Config in which the change occured.

public Config Config { get; }

Property Value

Config

HadValue

Gets whether the old value existed.

public bool HadValue { get; }

Property Value

bool

HasLabel

Gets whether a custom label was set by whoever changed the configuration.

public bool HasLabel { get; }

Property Value

bool

true if Label is not null; otherwise, false.

HasValue

Gets whether the new value exists.

public bool HasValue { get; }

Property Value

bool

IsChangedCollection

Gets whether this configuration item's changed value originated from an CollectionChanged event.

public bool IsChangedCollection { get; }

Property Value

bool

true if ChangedCollection is not null; otherwise, false.

IsChangedProperty

Gets whether this configuration item's changed value originated from an PropertyChanged event.

public bool IsChangedProperty { get; }

Property Value

bool

true if ChangedProperty is not null; otherwise, false.

Key

Gets the configuration item who's value changed.

public IDefiningConfigKey<T> Key { get; }

Property Value

IDefiningConfigKey<T>

Label

Gets a custom label that may be set by whoever changed the configuration.

public string? Label { get; }

Property Value

string

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