SynchronizedKeyedCollection<K, T> Class

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

System.Object
  System.Collections.Generic.SynchronizedCollection<T>
    System.Collections.Generic.SynchronizedKeyedCollection<K, T>
      System.ServiceModel.UriSchemeKeyedCollection

Namespace:  System.Collections.Generic
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

[ComVisibleAttribute(false)]
public abstract class SynchronizedKeyedCollection<K, T> : SynchronizedCollection<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.

The SynchronizedKeyedCollection<K, T> type exposes the following members.

  NameDescription
Protected methodSynchronizedKeyedCollection<K, T>()Initializes a new instance of the SynchronizedKeyedCollection<K, T> class.
Protected methodSynchronizedKeyedCollection<K, T>(Object)Initializes a new instance of the SynchronizedKeyedCollection<K, T> class with access synchronized by an explicitly specified object.
Protected methodSynchronizedKeyedCollection<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.
Protected methodSynchronizedKeyedCollection<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.
Top

  NameDescription
Public propertyCountGets the number of elements contained in the thread-safe collection. (Inherited from SynchronizedCollection<T>.)
Protected propertyDictionaryGets the dictionary associated with the collection.
Public propertyItem[K]Gets the items with a specified key from the collection.
Public propertyItem[Int32]Gets an element from the thread-safe collection with a specified index. (Inherited from SynchronizedCollection<T>.)
Protected propertyItemsGets the list of elements contained in the thread-safe collection. (Inherited from SynchronizedCollection<T>.)
Public propertySyncRootGets the object used to synchronize access to the thread-safe collection. (Inherited from SynchronizedCollection<T>.)
Top

  NameDescription
Public methodAddAdds an item to the thread-safe, read-only collection. (Inherited from SynchronizedCollection<T>.)
Protected methodChangeItemKeyChanges the key for a specified item in the synchronized collection.
Public methodClearRemoves all items from the collection. (Inherited from SynchronizedCollection<T>.)
Protected methodClearItemsClears all items from the collection. (Overrides SynchronizedCollection<T>.ClearItems().)
Public methodContains(T)Determines whether the collection contains an element with a specific value. (Inherited from SynchronizedCollection<T>.)
Public methodContains(K)Returns a value that indicates whether the collection contains an item with a specified key.
Public methodCopyToCopies the elements of the collection to a specified array, starting at a particular index. (Inherited from SynchronizedCollection<T>.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorReturns an enumerator that iterates through the synchronized collection. (Inherited from SynchronizedCollection<T>.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Protected methodGetKeyForItemWhen overridden in a derived class, gets the key for a specified item.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIndexOfReturns the index of the first occurrence of a value in the collection. (Inherited from SynchronizedCollection<T>.)
Public methodInsertInserts an item into the collection at a specified index. (Inherited from SynchronizedCollection<T>.)
Protected methodInsertItemInserts an item into the collection at a specified location. (Overrides SynchronizedCollection<T>.InsertItem(Int32, T).)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRemove(T)Removes the first occurrence of a specified item from the collection. (Inherited from SynchronizedCollection<T>.)
Public methodRemove(K)Removes an item with a specified key from the collection and returns a value that indicates whether an item was removed.
Public methodRemoveAtRemoves an item at a specified index from the collection. (Inherited from SynchronizedCollection<T>.)
Protected methodRemoveItemRemoves an item at a specified location from the collection. (Overrides SynchronizedCollection<T>.RemoveItem(Int32).)
Protected methodSetItemReplaces an item at a specified location of the collection with a new item. (Overrides SynchronizedCollection<T>.SetItem(Int32, T).)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Explicit interface implemetationPrivate methodICollection.CopyToCopies the elements of the collection to a specified array, starting at a particular index. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetationPrivate propertyICollection<T>.IsReadOnlyGets a value that indicates whether the collection is read only. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetationPrivate propertyICollection.IsSynchronizedGets a value that indicates whether the collection is thread safe. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetationPrivate propertyICollection.SyncRootGets the object used to synchronize access to the thread-safe collection. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorReturns an enumerator that iterates through the synchronized collection. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetationPrivate methodIList.AddAdds an element to the collection. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetationPrivate methodIList.ContainsDetermines whether the collection contains an element with a specific value. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetationPrivate methodIList.IndexOfDetermines the zero-based index of an element in the collection. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetationPrivate methodIList.InsertInserts an object into the collection at a specified index. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetationPrivate propertyIList.IsFixedSizeGets a value that indicates whether the collection is fixed in size. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetationPrivate propertyIList.IsReadOnlyGets a value that indicates whether the collection is read only. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetationPrivate propertyIList.ItemGets or sets the item at a specified zero-based index. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetationPrivate methodIList.RemoveRemoves the first occurrence of a specified object as an element from the collection. (Inherited from SynchronizedCollection<T>.)
Top

Inherited by UriSchemeKeyedCollection for use hosting.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft