Class CollectionExtensions
Extension methods for ICollection<T> implementations.
Inherited Members
Namespace: GlitchedPolygons.ExtensionMethods
Assembly: GlitchedPolygons.ExtensionMethods.dll
Syntax
public static class CollectionExtensions
Methods
| Improve this Doc View SourceNotNullNotEmpty<T>(ICollection<T>)
Returns true if the collection
is not null
and has at least 1 element in it.
Declaration
public static bool NotNullNotEmpty<T>(this ICollection<T> collection)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | collection | The collection to check. |
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T |
NullOrEmpty<T>(ICollection<T>)
Determines whether the collection is null
or empty.
Declaration
public static bool NullOrEmpty<T>(this ICollection<T> collection)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | collection | The list to check. |
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T |
UnorderedEqual<T>(ICollection<T>, ICollection<T>)
Checks whether the two ICollection<T> are equal (have the same elements).
The order of the elements is not important; e.g. {1,2,3} and {2,3,1} would returntrue
.
Declaration
public static bool UnorderedEqual<T>(this ICollection<T> a, ICollection<T> b)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | a | Collection to compare. |
ICollection<T> | b | Collection to compare. |
Returns
Type | Description |
---|---|
bool | Whether the two collections have the same elements. |
Type Parameters
Name | Description |
---|---|
T | ICollection<T> type parameter. |