Show / Hide Table of Contents

Class CollectionExtensions

Extension methods for ICollection<T> implementations.

Inheritance
object
CollectionExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: GlitchedPolygons.ExtensionMethods
Assembly: GlitchedPolygons.ExtensionMethods.dll
Syntax
public static class CollectionExtensions

Methods

| Improve this Doc View Source

NotNullNotEmpty<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 collection != null && collection.Length > 0
Type Parameters
Name Description
T
| Improve this Doc View Source

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

true if the passed collection is either null or empty; otherwise, false.

Type Parameters
Name Description
T
| Improve this Doc View Source

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 return true.
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.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX