Show / Hide Table of Contents

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: UnityScriptsLibrary.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
System.Collections.Generic.ICollection<T> collection

The collection to check.

Returns
Type Description
System.Boolean

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
System.Collections.Generic.ICollection<T> collection

The list to check.

Returns
Type Description
System.Boolean

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

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