Show / Hide Table of Contents

Class ReadOnlyCollectionExtensions

Extension methods for IReadOnlyCollection<T> implementations.

Inheritance
object
ReadOnlyCollectionExtensions
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 ReadOnlyCollectionExtensions

Methods

NotNullNotEmptyReadOnly<T>(IReadOnlyCollection<T>)

Returns true if the collection is not null and has at least 1 element in it.

Declaration
public static bool NotNullNotEmptyReadOnly<T>(this IReadOnlyCollection<T> collection)
Parameters
Type Name Description
IReadOnlyCollection<T> collection

The collection to check.

Returns
Type Description
bool collection != null && collection.Length > 0
Type Parameters
Name Description
T

NullOrEmptyReadOnly<T>(IReadOnlyCollection<T>)

Determines whether the collection is null or empty.

Declaration
public static bool NullOrEmptyReadOnly<T>(this IReadOnlyCollection<T> collection)
Parameters
Type Name Description
IReadOnlyCollection<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

UnorderedEqualReadOnly<T>(IReadOnlyCollection<T>, IReadOnlyCollection<T>)

Checks whether the two IReadOnlyCollection<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 UnorderedEqualReadOnly<T>(this IReadOnlyCollection<T> a, IReadOnlyCollection<T> b)
Parameters
Type Name Description
IReadOnlyCollection<T> a

Collection to compare.

IReadOnlyCollection<T> b

Collection to compare.

Returns
Type Description
bool

Whether the two collections have the same elements.

Type Parameters
Name Description
T

IReadOnlyCollection<T> type parameter.

Back to top Generated by DocFX