Table of Contents

Class ICollectionExt

Namespace
Tlabs.Misc
Assembly
Tlabs.Core.dll

Extension methods for generic collection interfaces.

public static class ICollectionExt
Inheritance
ICollectionExt
Inherited Members

Methods

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

Adds the elements of the specified rng to the end of collection col.

public static void AddRange<T>(this ICollection<T> col, IEnumerable<T> rng)

Parameters

col ICollection<T>
rng IEnumerable<T>

Type Parameters

T

ContentEquals<T>(IEnumerable<T>, IEnumerable<T>)

Compares IEnumerable<T> contents for equality.

public static bool ContentEquals<T>(this IEnumerable<T> seq, IEnumerable<T> other) where T : class

Parameters

seq IEnumerable<T>
other IEnumerable<T>

Returns

bool

Type Parameters

T

ContentEquals<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>)

Compares IEnumerable<T> contents for equality.

public static bool ContentEquals<T>(this IEnumerable<T> seq, IEnumerable<T> other, IEqualityComparer<T> cmp) where T : class

Parameters

seq IEnumerable<T>
other IEnumerable<T>
cmp IEqualityComparer<T>

Returns

bool

Type Parameters

T

ContentEquals<K, T>(IDictionary<K, T>, IDictionary<K, T>)

Compares IDictionary<TKey, TValue> contents for equality.

public static bool ContentEquals<K, T>(this IDictionary<K, T> dict, IDictionary<K, T> other)

Parameters

dict IDictionary<K, T>
other IDictionary<K, T>

Returns

bool

Type Parameters

K
T

ContentEquals<K, T>(IDictionary<K, T>, IDictionary<K, T>, IEqualityComparer<T>)

Compares IDictionary<TKey, TValue> contents for equality.

public static bool ContentEquals<K, T>(this IDictionary<K, T> dict, IDictionary<K, T> other, IEqualityComparer<T> cmp)

Parameters

dict IDictionary<K, T>
other IDictionary<K, T>
cmp IEqualityComparer<T>

Returns

bool

Type Parameters

K
T

GetOrAdd<T>(ISet<T>, T, IEqualityComparer<T>?)

Gets an exisiting or adds the itm to the ISet<T>.

public static T GetOrAdd<T>(this ISet<T> set, T itm, IEqualityComparer<T>? cmp = null)

Parameters

set ISet<T>
itm T
cmp IEqualityComparer<T>

Returns

T

Type Parameters

T