Implements a thread-safe ISet wrapper.
The following tables list the members exposed by the SynchronizedSet type.
Public Methods
| Name | Description | |
|---|---|---|
| Add |
Adds the specified element to this set if it is not already present.
(Overrides .Add(Object).) | |
| AddAll |
Adds all the elements in the specified collection to the set if they are not already present.
(Overrides .AddAll(ICollection).) | |
| Clear |
Removes all objects from the set.
(Overrides .Clear().) | |
| Clone |
Returns a clone of this instance.
(Overrides .Clone().) | |
| Contains |
Returns trueTruetrue if this set contains the specified element.
(Overrides .Contains(Object).) | |
| ContainsAll |
Returns trueTruetrue if the set contains all the elements in the specified collection.
(Overrides .ContainsAll(ICollection).) | |
| CopyTo |
Copies the elements in the set to an array. The type of array needs
to be compatible with the objects in the set, obviously.
(Overrides .CopyTo(Array, Int32).) | |
| GetEnumerator |
Returns an enumerator that iterates through the set.
(Overrides .GetEnumerator().) | |
| Remove |
Removes the specified element from the set.
(Overrides .Remove(Object).) | |
| RemoveAll |
Remove all the specified elements from this set, if they exist in this set.
(Overrides .RemoveAll(ICollection).) | |
| RetainAll |
Retains only the elements in this set that are contained in the specified collection.
(Overrides .RetainAll(ICollection).) |
Public Constructors
| Name | Description | |
|---|---|---|
| SynchronizedSetNew |
Constructs a thread-safe ISet wrapper.
|
Public Properties
| Name | Description | |
|---|---|---|
| Count |
The number of elements contained in this collection.
(Overrides .Count.) | |
| IsEmpty |
Returns trueTruetrue if this set contains no elements.
(Overrides .IsEmpty.) | |
| IsSynchronized |
Returns trueTruetrue, indicating that this object is thread-safe. The exception to this
is enumeration, which is inherently not thread-safe. Use the SyncRoot object to
lock this object for the entire duration of the enumeration.
(Overrides .IsSynchronized.) | |
| SyncRoot |
Returns an object that can be used to synchronize the set between threads.
(Overrides .SyncRoot.) |