Table of Contents

Class CollectionExtensions

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

Various class extensions for generic collections.

public static class CollectionExtensions
Inheritance
CollectionExtensions
Inherited Members

Methods

AddElement<TKey, TValue, TCollection>(IDictionary<TKey, TCollection>, TKey, TValue)

Adds an element to a mutable lookup table
(E.g. Dictionary<Key,List<Value>>)

AddRange<T>(IList<T>, IEnumerable<T>)

Adds a range of values to the specified IList.

ContainsElement<TKey, TValue, TCollection>(IDictionary<TKey, TCollection>, TKey, TValue)

Queries if a certain value exists in a mutable lookup table
(E.g. Dictionary<Key,List<Value>>)

DisposeAll(IEnumerable<IDisposable?>?)
InsertOrdered<T>(List<T>, T, IComparer<T>?)

Inserts an item into an already sorted list.

RemoveElement<TKey, TValue, TCollection>(IDictionary<TKey, TCollection>, TKey, TValue)

Removes an element from a mutable lookup table
(E.g. Dictionary<Key,List<Value>>)

SafeGet<TKey, TValue>(IDictionary<TKey, TValue>, TKey)
SafeYield<T>(T?)

Wraps this object instance into an IEnumerable<T> consisting of a single item.
If the item is null, returns an empty enumerable instead.

Yield<T>(T)

Wraps this object instance into an IEnumerable<T> consisting of a single item.