Class ConcurrentHashSet<T>
A thread-safe representation of a 
Inheritance
Namespace: Umbraco.Cms.Core.Collections
Assembly: Umbraco.Core.dll
Syntax
public class ConcurrentHashSet<T>Type Parameters
| Name | Description | 
|---|---|
| T | 
Properties
View SourceCount
Gets the number of elements contained in the System.Collections.ICollection.
Declaration
public int Count { get; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | The number of elements contained in the System.Collections.ICollection. | 
IsReadOnly
Gets a value indicating whether the System.Collections.Generic.ICollection`1 is read-only.
Declaration
public bool IsReadOnly { get; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | true if the System.Collections.Generic.ICollection`1 is read-only; otherwise, false. | 
Methods
View SourceAdd(T)
Adds an item to the System.Collections.Generic.ICollection`1.
Declaration
public void Add(T item)Parameters
| Type | Name | Description | 
|---|---|---|
| T | item | The object to add to the System.Collections.Generic.ICollection`1. | 
Exceptions
| Type | Condition | 
|---|---|
| System.NotSupportedException | The System.Collections.Generic.ICollection`1 is read-only. | 
Clear()
Removes all items from the System.Collections.Generic.ICollection`1.
Declaration
public void Clear()Exceptions
| Type | Condition | 
|---|---|
| System.NotSupportedException | The System.Collections.Generic.ICollection`1 is read-only. | 
Contains(T)
Determines whether the System.Collections.Generic.ICollection`1 contains a specific value.
Declaration
public bool Contains(T item)Parameters
| Type | Name | Description | 
|---|---|---|
| T | item | The object to locate in the System.Collections.Generic.ICollection`1. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | true if  | 
CopyTo(T[], Int32)
Copies the elements of the System.Collections.Concurrent.IProducerConsumerCollection`1 to an System.Array, starting at a specified index.
Declaration
public void CopyTo(T[] array, int index)Parameters
| Type | Name | Description | 
|---|---|---|
| T[] | array | The one-dimensional System.Array that is the destination of the elements copied from the System.Collections.Concurrent.IProducerConsumerCollection`1. The array must have zero-based indexing. | 
| System.Int32 | index | The zero-based index in  | 
Exceptions
| Type | Condition | 
|---|---|
| System.ArgumentNullException | 
 | 
| System.ArgumentOutOfRangeException | 
 | 
| System.ArgumentException | 
 | 
CopyTo(Array, Int32)
Copies the elements of the System.Collections.ICollection to an System.Array, starting at a particular System.Array index.
Declaration
public void CopyTo(Array array, int index)Parameters
| Type | Name | Description | 
|---|---|---|
| Array | array | The one-dimensional System.Array that is the destination of the elements copied from System.Collections.ICollection. The System.Array must have zero-based indexing. | 
| System.Int32 | index | The zero-based index in  | 
Exceptions
| Type | Condition | 
|---|---|
| System.ArgumentNullException | 
 | 
| System.ArgumentOutOfRangeException | 
 | 
| System.ArgumentException | 
 | 
| System.ArgumentException | The type of the source System.Collections.ICollection
cannot be cast automatically to the type of the destination  | 
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<T> GetEnumerator()Returns
| Type | Description | 
|---|---|
| System.Collections.IEnumerator<T> | A System.Collections.Generic.IEnumerator`1 that can be used to iterate through the collection. | 
Remove(T)
Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection`1.
Declaration
public bool Remove(T item)Parameters
| Type | Name | Description | 
|---|---|---|
| T | item | The object to remove from the System.Collections.Generic.ICollection`1. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | true if  | 
Exceptions
| Type | Condition | 
|---|---|
| System.NotSupportedException | The System.Collections.Generic.ICollection`1 is read-only. | 
TryAdd(T)
Attempts to add an item to the collection
Declaration
public bool TryAdd(T item)Parameters
| Type | Name | Description | 
|---|---|---|
| T | item | 
Returns
| Type | Description | 
|---|---|
| System.Boolean |