Class CollectionUtils
Inheritance
System.Object
CollectionUtils
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Bayat.Json.Runtime.dll
Syntax
public static class CollectionUtils
Methods
|
Improve this Doc
View Source
AddDistinct<T>(IList<T>, T)
Declaration
public static bool AddDistinct<T>(this IList<T> list, T value)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IList<T> |
list |
|
T |
value |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
|
Improve this Doc
View Source
AddDistinct<T>(IList<T>, T, IEqualityComparer<T>)
Declaration
public static bool AddDistinct<T>(this IList<T> list, T value, IEqualityComparer<T> comparer)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IList<T> |
list |
|
T |
value |
|
System.Collections.Generic.IEqualityComparer<T> |
comparer |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
|
Improve this Doc
View Source
AddRange<T>(IList<T>, IEnumerable<T>)
Adds the elements of the specified collection to the specified generic IList.
Declaration
public static void AddRange<T>(this IList<T> initial, IEnumerable<T> collection)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IList<T> |
initial |
The list to add to.
|
System.Collections.Generic.IEnumerable<T> |
collection |
The collection of elements to add.
|
Type Parameters
|
Improve this Doc
View Source
AddRangeDistinct<T>(IList<T>, IEnumerable<T>, IEqualityComparer<T>)
Declaration
public static bool AddRangeDistinct<T>(this IList<T> list, IEnumerable<T> values, IEqualityComparer<T> comparer)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IList<T> |
list |
|
System.Collections.Generic.IEnumerable<T> |
values |
|
System.Collections.Generic.IEqualityComparer<T> |
comparer |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
|
Improve this Doc
View Source
Contains<T>(List<T>, T, IEqualityComparer)
Declaration
public static bool Contains<T>(this List<T> list, T value, IEqualityComparer comparer)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<T> |
list |
|
T |
value |
|
System.Collections.IEqualityComparer |
comparer |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
|
Improve this Doc
View Source
ContainsValue<TSource>(IEnumerable<TSource>, TSource, IEqualityComparer<TSource>)
Declaration
public static bool ContainsValue<TSource>(this IEnumerable<TSource> source, TSource value, IEqualityComparer<TSource> comparer)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TSource> |
source |
|
TSource |
value |
|
System.Collections.Generic.IEqualityComparer<TSource> |
comparer |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
|
Improve this Doc
View Source
IndexOf<T>(IEnumerable<T>, Func<T, Boolean>)
Declaration
public static int IndexOf<T>(this IEnumerable<T> collection, Func<T, bool> predicate)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
collection |
|
System.Func<T, System.Boolean> |
predicate |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
|
Improve this Doc
View Source
IndexOfReference<T>(List<T>, T)
Declaration
public static int IndexOfReference<T>(this List<T> list, T item)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<T> |
list |
|
T |
item |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
|
Improve this Doc
View Source
IsDictionaryType(Type)
Declaration
public static bool IsDictionaryType(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsNullOrEmpty<T>(ICollection<T>)
Determines whether the collection is null or empty.
Declaration
public static bool IsNullOrEmpty<T>(ICollection<T> collection)
Parameters
Type |
Name |
Description |
System.Collections.Generic.ICollection<T> |
collection |
The collection.
|
Returns
Type |
Description |
System.Boolean |
true if the collection is null or empty; otherwise, false .
|
Type Parameters
|
Improve this Doc
View Source
ResolveEnumerableCollectionConstructor(Type, Type)
Declaration
public static ConstructorInfo ResolveEnumerableCollectionConstructor(Type collectionType, Type collectionItemType)
Parameters
Type |
Name |
Description |
System.Type |
collectionType |
|
System.Type |
collectionItemType |
|
Returns
Type |
Description |
System.Reflection.ConstructorInfo |
|
|
Improve this Doc
View Source
ResolveEnumerableCollectionConstructor(Type, Type, Type)
Declaration
public static ConstructorInfo ResolveEnumerableCollectionConstructor(Type collectionType, Type collectionItemType, Type constructorArgumentType)
Parameters
Type |
Name |
Description |
System.Type |
collectionType |
|
System.Type |
collectionItemType |
|
System.Type |
constructorArgumentType |
|
Returns
Type |
Description |
System.Reflection.ConstructorInfo |
|
|
Improve this Doc
View Source
ToMultidimensionalArray(IList, Type, Int32)
Declaration
public static Array ToMultidimensionalArray(IList values, Type type, int rank)
Parameters
Type |
Name |
Description |
System.Collections.IList |
values |
|
System.Type |
type |
|
System.Int32 |
rank |
|
Returns
Type |
Description |
System.Array |
|