SynchronizedKeyedCollection<K,T> SynchronizedKeyedCollection<K,T> SynchronizedKeyedCollection<K,T> SynchronizedKeyedCollection<K,T> Class

Definition

Provides a thread-safe collection that contains objects of a type specified by a generic parameter and that are grouped by keys.

generic <typename K, typename T>
public ref class SynchronizedKeyedCollection abstract : System::Collections::Generic::SynchronizedCollection<T>
[System.Runtime.InteropServices.ComVisible(false)]
public abstract class SynchronizedKeyedCollection<K,T> : System.Collections.Generic.SynchronizedCollection<T>
type SynchronizedKeyedCollection<'K, 'T> = class
    inherit SynchronizedCollection<'T>
Public MustInherit Class SynchronizedKeyedCollection(Of K, T)
Inherits SynchronizedCollection(Of T)

Type Parameters

K

The type of the key used to group the items contained in the collection.

T

The type of items contained in the thread-safe, keyed collection.

Inheritance
SynchronizedKeyedCollection<K,T>SynchronizedKeyedCollection<K,T>SynchronizedKeyedCollection<K,T>SynchronizedKeyedCollection<K,T>
Derived
Attributes

Remarks

Inherited by UriSchemeKeyedCollection for use hosting.

Constructors

SynchronizedKeyedCollection<K,T>() SynchronizedKeyedCollection<K,T>() SynchronizedKeyedCollection<K,T>() SynchronizedKeyedCollection<K,T>()

Initializes a new instance of the SynchronizedKeyedCollection<K,T> class.

SynchronizedKeyedCollection<K,T>(Object) SynchronizedKeyedCollection<K,T>(Object) SynchronizedKeyedCollection<K,T>(Object) SynchronizedKeyedCollection<K,T>(Object)

Initializes a new instance of the SynchronizedKeyedCollection<K,T> class with access synchronized by an explicitly specified object.

SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>) SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>) SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>) SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>)

Initializes a new instance of the SynchronizedKeyedCollection<K,T> class with access synchronized by an explicitly specified object and with keys compared in a specified way.

SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>, Int32) SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>, Int32) SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>, Int32) SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>, Int32)

Initializes a new instance of the SynchronizedKeyedCollection<K,T> class with access synchronized by an explicitly specified object and with keys compared in a specified way.

Properties

Count Count Count Count

Gets the number of elements contained in the thread-safe collection.

(Inherited from SynchronizedCollection<T>)
Dictionary Dictionary Dictionary Dictionary

Gets the dictionary associated with the collection.

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

Gets a value that indicates whether the collection is thread safe.

(Inherited from SynchronizedCollection<T>)
ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

Gets the object used to synchronize access to the thread-safe collection.

(Inherited from SynchronizedCollection<T>)
ICollection<T>.IsReadOnly ICollection<T>.IsReadOnly ICollection<T>.IsReadOnly ICollection<T>.IsReadOnly

Gets a value that indicates whether the collection is read only.

(Inherited from SynchronizedCollection<T>)
IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

Gets a value that indicates whether the collection is fixed in size.

(Inherited from SynchronizedCollection<T>)
IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly

Gets a value that indicates whether the collection is read only.

(Inherited from SynchronizedCollection<T>)
IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

Gets or sets the item at a specified zero-based index.

(Inherited from SynchronizedCollection<T>)
Items Items Items Items

Gets the list of elements contained in the thread-safe collection.

(Inherited from SynchronizedCollection<T>)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

Gets an element from the thread-safe collection with a specified index.

(Inherited from SynchronizedCollection<T>)
Item[K] Item[K] Item[K] Item[K]

Gets the items with a specified key from the collection.

SyncRoot SyncRoot SyncRoot SyncRoot

Gets the object used to synchronize access to the thread-safe collection.

(Inherited from SynchronizedCollection<T>)

Methods

Add(T) Add(T) Add(T) Add(T)

Adds an item to the thread-safe, read-only collection.

(Inherited from SynchronizedCollection<T>)
ChangeItemKey(T, K) ChangeItemKey(T, K) ChangeItemKey(T, K) ChangeItemKey(T, K)

Changes the key for a specified item in the synchronized collection.

Clear() Clear() Clear() Clear()

Removes all items from the collection.

(Inherited from SynchronizedCollection<T>)
ClearItems() ClearItems() ClearItems() ClearItems()

Clears all items from the collection.

Contains(K) Contains(K) Contains(K) Contains(K)

Returns a value that indicates whether the collection contains an item with a specified key.

CopyTo(T[], Int32) CopyTo(T[], Int32) CopyTo(T[], Int32) CopyTo(T[], Int32)

Copies the elements of the collection to a specified array, starting at a particular index.

(Inherited from SynchronizedCollection<T>)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through the synchronized collection.

(Inherited from SynchronizedCollection<T>)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetKeyForItem(T) GetKeyForItem(T) GetKeyForItem(T) GetKeyForItem(T)

When overridden in a derived class, gets the key for a specified item.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
IndexOf(T) IndexOf(T) IndexOf(T) IndexOf(T)

Returns the index of the first occurrence of a value in the collection.

(Inherited from SynchronizedCollection<T>)
Insert(Int32, T) Insert(Int32, T) Insert(Int32, T) Insert(Int32, T)

Inserts an item into the collection at a specified index.

(Inherited from SynchronizedCollection<T>)
InsertItem(Int32, T) InsertItem(Int32, T) InsertItem(Int32, T) InsertItem(Int32, T)

Inserts an item into the collection at a specified location.

InsertItem(Int32, T) InsertItem(Int32, T) InsertItem(Int32, T) InsertItem(Int32, T)

Inserts an item into the collection at a specified index.

(Inherited from SynchronizedCollection<T>)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(K) Remove(K) Remove(K) Remove(K)

Removes an item with a specified key from the collection and returns a value that indicates whether an item was removed.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

Removes an item at a specified index from the collection.

(Inherited from SynchronizedCollection<T>)
RemoveItem(Int32) RemoveItem(Int32) RemoveItem(Int32) RemoveItem(Int32)

Removes an item at a specified location from the collection.

SetItem(Int32, T) SetItem(Int32, T) SetItem(Int32, T) SetItem(Int32, T)

Replaces an item at a specified location of the collection with a new item.

SetItem(Int32, T) SetItem(Int32, T) SetItem(Int32, T) SetItem(Int32, T)

Replaces the item at a specified index with another item.

(Inherited from SynchronizedCollection<T>)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

Copies the elements of the collection to a specified array, starting at a particular index.

(Inherited from SynchronizedCollection<T>)
IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Returns an enumerator that iterates through the synchronized collection.

(Inherited from SynchronizedCollection<T>)
IList.Add(Object) IList.Add(Object) IList.Add(Object) IList.Add(Object)

Adds an element to the collection.

(Inherited from SynchronizedCollection<T>)
IList.Contains(Object) IList.Contains(Object) IList.Contains(Object) IList.Contains(Object)

Determines whether the collection contains an element with a specific value.

(Inherited from SynchronizedCollection<T>)
IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object)

Determines the zero-based index of an element in the collection.

(Inherited from SynchronizedCollection<T>)
IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object)

Inserts an object into the collection at a specified index.

(Inherited from SynchronizedCollection<T>)
IList.Remove(Object) IList.Remove(Object) IList.Remove(Object) IList.Remove(Object)

Removes the first occurrence of a specified object as an element from the collection.

(Inherited from SynchronizedCollection<T>)

Extension Methods

CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>)

Returns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

Copies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

Copies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>)

Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName)

Returns a filtered collection of elements that contains the ancestors of every node in the source collection. Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>)

Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>)

Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName)

Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>)

Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName)

Returns a filtered collection of the child elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>)

Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>)

Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>)

Removes every node in the source collection from its parent node.

Applies to