Class CollectionExtensions
Extension methods for System.Collections.Generic.ICollection<T> implementations.
Inheritance
System.Object
CollectionExtensions
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()
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 |
---|---|---|
System.Collections.Generic.ICollection<T> | collection | The collection to check. |
Returns
Type | Description |
---|---|
System.Boolean |
|
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 |
---|---|---|
System.Collections.Generic.ICollection<T> | collection | The list to check. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T |
UnorderedEqual<T>(ICollection<T>, ICollection<T>)
Checks whether the two System.Collections.Generic.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 return
true
.
Declaration
public static bool UnorderedEqual<T>(this ICollection<T> a, ICollection<T> b)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<T> | a | Collection to compare. |
System.Collections.Generic.ICollection<T> | b | Collection to compare. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the two collections have the same elements. |
Type Parameters
Name | Description |
---|---|
T | System.Collections.Generic.ICollection<T> type parameter. |