SynchronizedList<T>
Wisej.Core.SynchronizedList<T>
Last updated
Was this helpful?
Wisej.Core.SynchronizedList<T>
Last updated
Was this helpful?
Namespace: Wisej.Core
Assembly: Wisej.Framework (3.2.0.0)
Provides a thread-safe collection that contains objects of a type specified by the generic parameter as elements.
T
The type of object contained as items in the thread-safe collection.
Initializes a new instance of the class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied and uses the specified syncLock object to synchronize its internal operations.
capacity
The optional number of element that the list can initially store.
collection
The optional collection whose elements are copied to the new list.
syncLock
The optional lock reference.
Throws:
Adds an item to the thread-safe collection.
item
The element to be added to the collection.
collection
Throws:
item
The object to locate. The value can be null for reference types.
Throws:
item
The object to locate. The value can be null for reference types.
comparer
Throws:
Removes all items from the collection.
Determines whether the collection contains an element with a specific value.
item
The object to locate in the collection.
Copies the elements of the collection to a specified array, starting at a particular index.
array
index
The zero-based index in the array at which copying begins.
match
Throws:
startIndex
The zero-based starting index of the search.
match
Throws:
Retrieves all the elements that match the conditions defined by the specified predicate.
match
Throws:
match
Throws:
startIndex
The zero-based starting index of the search.
match
Throws:
startIndex
The zero-based starting index of the search.
count
The number of elements in the section to search.
match
Throws:
match
Throws:
startIndex
The zero-based starting index of the search.
match
Throws:
match
Throws:
startIndex
The zero-based starting index of the search.
match
Throws:
action
Throws:
Returns an enumerator that iterates through the synchronized collection.
Returns the index of the first occurrence of a value in the collection.
item
Removes all items from the collection.
Inserts an item into the collection at a specified index.
index
The zero-based index of the element to be retrieved from the collection.
item
The object to be inserted into the collection as an element.
Throws:
index
The zero-based index at which the new elements should be inserted.
collection
Throws:
Removes the first occurrence of a specified item from the collection.
item
The object to remove from the collection.
Removes all the elements that match the conditions defined by the specified predicate.
match
Throws:
Removes an item at a specified index from the collection.
index
The zero-based index of the element to be retrieved from the collection.
Throws:
Throws:
comparer
Throws:
comparison
Throws:
comparer
An optional callback method, invoked on every swap. If the callback returns true to indicate that it handled the swap, the default swap is not performed.
Throws:
Computes the sum of the sequence of System.Int32 values that are obtained by invoking a transform function on each element of the list.
selector
A transform function to apply to each element.
Throws:
Computes the sum of the sequence of System.Int64 values that are obtained by invoking a transform function on each element of the list.
selector
A transform function to apply to each element.
Throws:
Computes the sum of the sequence of System.Single values that are obtained by invoking a transform function on each element of the list.
selector
A transform function to apply to each element.
Throws:
Computes the sum of the sequence of System.Double values that are obtained by invoking a transform function on each element of the list.
selector
A transform function to apply to each element.
Throws:
Computes the sum of the sequence of System.Decimal values that are obtained by invoking a transform function on each element of the list.
selector
A transform function to apply to each element.
Throws:
: Gets the number of elements contained in the thread-safe collection.
: Gets an element from the thread-safe collection with a specified index.
The index specified is less than zero or greater than the number of items in the collection.
: Gets the object used to synchronize access to the thread-safe collection.
Adds the elements of the specified collection to the end of the .
The collection whose elements should be added to the end of the . The collection itself cannot be null, but it can contain elements that are null, for reference types.
collection is null.
Searches the entire sorted for an element using the default comparer and returns the zero-based index of the element.
Returns: . The zero-based index of item in the sorted , if item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element, the bitwise complement of .
The default comparer cannot find an implementation of the generic interface or the interface for the type of the collection elements.
Searches the entire sorted for an element using the specified comparer and returns the zero-based index of the element.
The implementation to use when comparing elements; or null to use the default comparer .
Returns: . The zero-based index of item in the sorted , if item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element, the bitwise complement of .
comparer is null, and the default comparer cannot find an implementation of the generic interface or the interface for the type of the collection elements.
Returns: . true if the element value is found in the collection; otherwise false.
The destination for the elements copied from the collection.
Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire .
The delegate that defines the conditions of the element to search for.
Returns: . The first element that matches the conditions defined by the specified predicate, if found; otherwise, the default value.
match is null.
Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire .
The delegate that defines the conditions of the element to search for.
Returns: . The first element that matches the conditions defined by the specified predicate, if found; otherwise, the default value.
match is null.
startIndex is outside the range of valid indexes for the .
The delegate that defines the conditions of the elements to search for.
Returns: . A containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty .
match is null.
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire .
The delegate that defines the conditions of the element to search for.
Returns: . The zero-based index of the first occurrence of an element that matches the conditions defined by match , if found; otherwise, –1.
match is null.
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the that extends from the specified index to the last element.
The delegate that defines the conditions of the element to search for.
Returns: . The zero-based index of the first occurrence of an element that matches the conditions defined by match , if found; otherwise, –1.
match is null.
startIndex is outside the range of valid indexes for the .
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the that starts at the specified index and contains the specified number of elements.
The delegate that defines the conditions of the element to search for.
Returns: . The zero-based index of the first occurrence of an element that matches the conditions defined by match , if found; otherwise, –1.
match is null.
startIndex is outside the range of valid indexes for the ; or count is less than 0; or startIndex and count do not specify a valid section in the .
Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire .
The delegate that defines the conditions of the element to search for.
Returns: . The last element that matches the conditions defined by the specified predicate, if found; otherwise, the default value.
match is null.
Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire .
The delegate that defines the conditions of the element to search for.
Returns: . The last element that matches the conditions defined by the specified predicate, if found; otherwise, the default value.
match is null.
startIndex is outside the range of valid indexes for the .
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire .
The delegate that defines the conditions of the element to search for.
Returns: . The zero-based index of the last occurrence of an element that matches the conditions defined by match , if found; otherwise, –1.
match is null.
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the that extends from the specified index to the last element.
The delegate that defines the conditions of the element to search for.
Returns: . The zero-based index of the last occurrence of an element that matches the conditions defined by match , if found; otherwise, –1.
match is null.
startIndex is outside the range of valid indexes for the .
Performs the specified action on each element of the .
The delegate to perform on each element of the .
action is null.
Returns: . An for objects of the type stored in the collection.
Returns: . The zero-based index of the first occurrence of the value in the collection.
The index specified is less than zero or greater than the number of items in the collection.
Inserts the elements of a collection into the at the specified index.
The collection whose elements should be inserted into the . The collection itself cannot be null, but it can contain elements that are null, for reference types.
collection is null.
index is less than 0; or index is greater than .
Returns: . true if item was successfully removed from the collection; otherwise, false.
The delegate that defines the conditions of the elements to remove.
Returns: . The number of elements removed from the .
match is null.
The index specified is less than zero or greater than the number of items in the collection.
Sorts the elements in the entire using the default comparer.
The default comparer cannot find an implementation of the generic interface or the interface for the type of the collection elements.
Sorts the elements in the entire using the specified comparer.
The implementation to use when comparing elements, or null to use the default comparer .
comparer is null, and the default comparer cannot find implementation of the generic interface or the interface for the type of the collection elements.
The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself.
Sorts the elements in the entire using the specified .
The to use when comparing elements.
comparison is null.
The implementation of comparison caused an error during the sort. For example, comparison might not return 0 when comparing an item with itself.
Sorts the elements in the entire using the specified comparer and a related to sort in sync with this collection.
The implementation to use when comparing elements, or null to use the default comparer .
swapCallback
comparer is null, and the default comparer cannot find implementation of the generic interface or the interface for the type of the collection elements.
The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself.
Returns: . The sum of the returned values.
selector is null.
Returns: . The sum of the returned values.
selector is null.
Returns: . The sum of the returned values.
selector is null.
Returns: . The sum of the returned values.
selector is null.
Returns: . The sum of the returned values.
selector is null.
Copies the elements of the to a new array.
Returns: . An array containing copies of the elements of the .
Sets the capacity to the actual number of elements in the , if that number is less than a threshold value.