View Source
Class ConcurrentHashSet<T>
A thread-safe representation of a System.Collections.Generic.HashSet<T>.
Enumerating this collection is thread-safe and will only operate on a clone that is generated before returning the
enumerator.
Assembly: Umbraco.Core.dll
Syntax
public class ConcurrentHashSet<T>
Type Parameters
Constructors
View Source
ConcurrentHashSet()
Declaration
public ConcurrentHashSet()
Properties
View Source
Count
Gets the number of elements contained in the System.Collections.ICollection.
Declaration
public int Count { get; }
Property Value
| Type |
Description |
| int |
The number of elements contained in the System.Collections.ICollection.
|
View Source
IsReadOnly
Gets a value indicating whether the System.Collections.Generic.ICollection<T> is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
| Type |
Description |
| bool |
true if the System.Collections.Generic.ICollection<T> is read-only; otherwise, false.
|
Methods
View Source
Add(T)
Adds an item to the System.Collections.Generic.ICollection<T>.
Declaration
Parameters
| Type |
Name |
Description |
| T |
item |
The object to add to the System.Collections.Generic.ICollection<T>.
|
Exceptions
| Type |
Condition |
| NotSupportedException |
The System.Collections.Generic.ICollection<T> is
read-only.
|
View Source
Clear()
Removes all items from the System.Collections.Generic.ICollection<T>.
Declaration
Exceptions
| Type |
Condition |
| NotSupportedException |
The System.Collections.Generic.ICollection<T> is
read-only.
|
View Source
Contains(T)
Determines whether the System.Collections.Generic.ICollection<T> 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<T>.
|
Returns
| Type |
Description |
| bool |
true if item is found in the System.Collections.Generic.ICollection<T>;
otherwise, false.
|
View Source
CopyTo(Array, int)
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.
|
| int |
index |
The zero-based index in array at which copying begins.
|
Exceptions
| Type |
Condition |
| ArgumentNullException |
array is null.
|
| ArgumentOutOfRangeException |
index is less than zero.
|
| ArgumentException |
array is multidimensional.-or- The number of elements
in the source System.Collections.ICollection is greater than the available space from
index to the end of the destination array.
|
| ArgumentException |
The type of the source System.Collections.ICollection
cannot be cast automatically to the type of the destination array.
|
View Source
CopyTo(T[], int)
Copies the elements of the System.Collections.Concurrent.IProducerConsumerCollection<T> 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<T>. The array must have
zero-based indexing.
|
| int |
index |
The zero-based index in array at which copying begins.
|
Exceptions
| Type |
Condition |
| ArgumentNullException |
array is a null reference (Nothing in Visual
Basic).
|
| ArgumentOutOfRangeException |
index is less than zero.
|
| ArgumentException |
index is equal to or greater than the length of the
array -or- The number of elements in the source
System.Collections.Concurrent.ConcurrentQueue<T> is greater than the available space from
index to the end of the destination array.
|
View Source
ExceptWith(IEnumerable<T>)
Declaration
public void ExceptWith(IEnumerable<T> other)
Parameters
| Type |
Name |
Description |
| IEnumerable<T> |
other |
|
View Source
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<T> GetEnumerator()
Returns
| Type |
Description |
| IEnumerator<T> |
A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection.
|
View Source
IntersectWith(IEnumerable<T>)
Declaration
public void IntersectWith(IEnumerable<T> other)
Parameters
| Type |
Name |
Description |
| IEnumerable<T> |
other |
|
View Source
IsProperSubsetOf(IEnumerable<T>)
Declaration
public bool IsProperSubsetOf(IEnumerable<T> other)
Parameters
| Type |
Name |
Description |
| IEnumerable<T> |
other |
|
Returns
View Source
IsProperSupersetOf(IEnumerable<T>)
Declaration
public bool IsProperSupersetOf(IEnumerable<T> other)
Parameters
| Type |
Name |
Description |
| IEnumerable<T> |
other |
|
Returns
View Source
IsSubsetOf(IEnumerable<T>)
Declaration
public bool IsSubsetOf(IEnumerable<T> other)
Parameters
| Type |
Name |
Description |
| IEnumerable<T> |
other |
|
Returns
View Source
IsSupersetOf(IEnumerable<T>)
Declaration
public bool IsSupersetOf(IEnumerable<T> other)
Parameters
| Type |
Name |
Description |
| IEnumerable<T> |
other |
|
Returns
View Source
Overlaps(IEnumerable<T>)
Declaration
public bool Overlaps(IEnumerable<T> other)
Parameters
| Type |
Name |
Description |
| IEnumerable<T> |
other |
|
Returns
View Source
Remove(T)
Removes the first occurrence of a specific object from the
System.Collections.Generic.ICollection<T>.
Declaration
public bool Remove(T item)
Parameters
| Type |
Name |
Description |
| T |
item |
The object to remove from the System.Collections.Generic.ICollection<T>.
|
Returns
| Type |
Description |
| bool |
true if item was successfully removed from the
System.Collections.Generic.ICollection<T>; otherwise, false. This method also returns false if
item is not found in the original System.Collections.Generic.ICollection<T>.
|
Exceptions
| Type |
Condition |
| NotSupportedException |
The System.Collections.Generic.ICollection<T> is
read-only.
|
View Source
SetEquals(IEnumerable<T>)
Declaration
public bool SetEquals(IEnumerable<T> other)
Parameters
| Type |
Name |
Description |
| IEnumerable<T> |
other |
|
Returns
View Source
SymmetricExceptWith(IEnumerable<T>)
Declaration
public void SymmetricExceptWith(IEnumerable<T> other)
Parameters
| Type |
Name |
Description |
| IEnumerable<T> |
other |
|
View Source
TryAdd(T)
Attempts to add an item to the collection
Declaration
public bool TryAdd(T item)
Parameters
| Type |
Name |
Description |
| T |
item |
|
Returns
View Source
UnionWith(IEnumerable<T>)
Declaration
public void UnionWith(IEnumerable<T> other)
Parameters
| Type |
Name |
Description |
| IEnumerable<T> |
other |
|