ICollection(T).Add Method

HashSet<T>.ICollection<T>.Add Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Adds an item to an ICollection<T> object.

Namespace:  System.Collections.Generic
Assembly:  System.Core (in System.Core.dll)

void ICollection<T>.Add(
	T item
)

Parameters

item
Type: T
The object to add to the ICollection<T> object.

Implements

ICollection<T>.Add(T)

ExceptionCondition
NotSupportedException

The ICollection<T> is read-only.

If Count is less than Capacity, this method is an O(1) operation. If the capacity must be increased to accommodate the new element, this method becomes an O(n) operation, where n is Count.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft