Skip to content

CollectionChangedArgsExtensions Class

C#
public static class CollectionChangedArgsExtensions

Inheritance object

ToNotifyCollectionChangedEventArgs<T>(CollectionChangedArgs<T>)

Section titled “ToNotifyCollectionChangedEventArgs<T>(CollectionChangedArgs<T>)”

Converts the Hertzole.ScriptableValues.CollectionChangedArgs1 to a NotifyCollectionChangedEventArgs.

C#
public static NotifyCollectionChangedEventArgs ToNotifyCollectionChangedEventArgs<T>(this CollectionChangedArgs<T> args)

args CollectionChangedArgs<T>
The current args.

NotifyCollectionChangedEventArgs
The converted NotifyCollectionChangedEventArgs.

NotSupportedException
args.Action is not supported.

TryGetNewValue<TKey, TValue>(CollectionChangedArgs<KeyValuePair<TKey, TValue>>, TKey, out TValue?)

Section titled “TryGetNewValue<TKey, TValue>(CollectionChangedArgs<KeyValuePair<TKey, TValue>>, TKey, out TValue?)”

Helper method to get a value from the Hertzole.ScriptableValues.CollectionChangedArgs1.NewItems based on the given key.

C#
public static bool TryGetNewValue<TKey, TValue>(this CollectionChangedArgs<KeyValuePair<TKey, TValue>> args, TKey key, out TValue? value)

args CollectionChangedArgs<KeyValuePair<TKey, TValue>>
The current args.

key TKey
The key to find the value for.

value TValue
The found value, if any.

bool
https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true if a value was found; otherwise https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false.

TryGetOldValue<TKey, TValue>(CollectionChangedArgs<KeyValuePair<TKey, TValue>>, TKey, out TValue?)

Section titled “TryGetOldValue<TKey, TValue>(CollectionChangedArgs<KeyValuePair<TKey, TValue>>, TKey, out TValue?)”

Helper method to get a value from the Hertzole.ScriptableValues.CollectionChangedArgs1.OldItems based on the given key.

C#
public static bool TryGetOldValue<TKey, TValue>(this CollectionChangedArgs<KeyValuePair<TKey, TValue>> args, TKey key, out TValue? value)

args CollectionChangedArgs<KeyValuePair<TKey, TValue>>
The current args.

key TKey
The key to find the value for.

value TValue
The found value, if any.

bool
https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true if a value was found; otherwise https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false.