0 out of 1 rated this helpful - Rate this topic

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.

  Name Description
Protected method SynchronizedKeyedCollection<K, T>() Initializes a new instance of the SynchronizedKeyedCollection<K, T> class.
Protected method SynchronizedKeyedCollection<K, T>(Object) Initializes a new instance of the SynchronizedKeyedCollection<K, T> class with access synchronized by an explicitly specified object.
Protected method 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.
Protected method 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.
Top
  Name Description
Public property Count Gets the number of elements contained in the thread-safe collection. (Inherited from SynchronizedCollection<T>.)
Protected property Dictionary Gets the dictionary associated with the collection.
Public property Item[K] Gets the items with a specified key from the collection.
Public property Item[Int32] Gets an element from the thread-safe collection with a specified index. (Inherited from SynchronizedCollection<T>.)
Protected property Items Gets the list of elements contained in the thread-safe collection. (Inherited from SynchronizedCollection<T>.)
Public property SyncRoot Gets the object used to synchronize access to the thread-safe collection. (Inherited from SynchronizedCollection<T>.)
Top
  Name Description
Public method Add Adds an item to the thread-safe, read-only collection. (Inherited from SynchronizedCollection<T>.)
Protected method ChangeItemKey Changes the key for a specified item in the synchronized collection.
Public method Clear Removes all items from the collection. (Inherited from SynchronizedCollection<T>.)
Protected method ClearItems Clears all items from the collection. (Overrides SynchronizedCollection<T>.ClearItems().)
Public method Contains(T) Determines whether the collection contains an element with a specific value. (Inherited from SynchronizedCollection<T>.)
Public method Contains(K) Returns a value that indicates whether the collection contains an item with a specified key.
Public method CopyTo Copies the elements of the collection to a specified array, starting at a particular index. (Inherited from SynchronizedCollection<T>.)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetEnumerator Returns an enumerator that iterates through the synchronized collection. (Inherited from SynchronizedCollection<T>.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Protected method GetKeyForItem When overridden in a derived class, gets the key for a specified item.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method IndexOf Returns the index of the first occurrence of a value in the collection. (Inherited from SynchronizedCollection<T>.)
Public method Insert Inserts an item into the collection at a specified index. (Inherited from SynchronizedCollection<T>.)
Protected method InsertItem Inserts an item into the collection at a specified location. (Overrides SynchronizedCollection<T>.InsertItem(Int32, T).)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Remove(T) Removes the first occurrence of a specified item from the collection. (Inherited from SynchronizedCollection<T>.)
Public method Remove(K) Removes an item with a specified key from the collection and returns a value that indicates whether an item was removed.
Public method RemoveAt Removes an item at a specified index from the collection. (Inherited from SynchronizedCollection<T>.)
Protected method RemoveItem Removes an item at a specified location from the collection. (Overrides SynchronizedCollection<T>.RemoveItem(Int32).)
Protected method SetItem Replaces an item at a specified location of the collection with a new item. (Overrides SynchronizedCollection<T>.SetItem(Int32, T).)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Top
  Name Description
Explicit interface implemetation Private method ICollection.CopyTo Copies the elements of the collection to a specified array, starting at a particular index. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetation Private property ICollection<T>.IsReadOnly Gets a value that indicates whether the collection is read only. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetation Private property ICollection.IsSynchronized Gets a value that indicates whether the collection is thread safe. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetation Private property ICollection.SyncRoot Gets the object used to synchronize access to the thread-safe collection. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetation Private method IEnumerable.GetEnumerator Returns an enumerator that iterates through the synchronized collection. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetation Private method IList.Add Adds an element to the collection. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetation Private method IList.Contains Determines whether the collection contains an element with a specific value. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetation Private method IList.IndexOf Determines the zero-based index of an element in the collection. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetation Private method IList.Insert Inserts an object into the collection at a specified index. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetation Private property IList.IsFixedSize Gets a value that indicates whether the collection is fixed in size. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetation Private property IList.IsReadOnly Gets a value that indicates whether the collection is read only. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetation Private property IList.Item Gets or sets the item at a specified zero-based index. (Inherited from SynchronizedCollection<T>.)
Explicit interface implemetation Private method IList.Remove Removes 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, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ