Table of Contents

Class CollectionExtensions

Namespace
Loehnert.Utility.Collections
Assembly
Loehnert.Utility.dll

Extensions for ICollection<T>s.

public static class CollectionExtensions
Inheritance
CollectionExtensions
Inherited Members

Methods

TryAdd<T>(ICollection<T>, T)

Tries to add an item to a collection. To add the item, the collection must not be read only, and the collection must not contain the item.

public static bool TryAdd<T>(this ICollection<T> items, T item)

Parameters

items ICollection<T>

Collection to add the item.

item T

The item that should be add to the collection.

Returns

bool

True when the object was added.

Type Parameters

T

Type of the items.

Exceptions

ArgumentNullException

Thrown when items is null.