ReadOnlyDictionary<TKey, TValue> Class

A read-only version of IDictionary<TKey, TValue>.

Inheritance Hierarchy

System.Object
  Microsoft.TeamFoundation.Client.ReadOnlyDictionary<TKey, TValue>

Namespace:  Microsoft.TeamFoundation.Client
Assembly:  Microsoft.TeamFoundation.Client (in Microsoft.TeamFoundation.Client.dll)

Syntax

‘선언
Public Class ReadOnlyDictionary(Of TKey, TValue) _
    Implements IDictionary(Of TKey, TValue), ICollection(Of KeyValuePair(Of TKey, TValue)),  _
    IEnumerable(Of KeyValuePair(Of TKey, TValue)), IDictionary,  _
    ICollection, IEnumerable
public class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey, TValue>, 
    ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, 
    IDictionary, ICollection, IEnumerable
generic<typename TKey, typename TValue>
public ref class ReadOnlyDictionary : IDictionary<TKey, TValue>, 
    ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, 
    IDictionary, ICollection, IEnumerable
type ReadOnlyDictionary<'TKey, 'TValue> =  
    class
        interface IDictionary<'TKey, 'TValue>
        interface ICollection<KeyValuePair<'TKey, 'TValue>>
        interface IEnumerable<KeyValuePair<'TKey, 'TValue>>
        interface IDictionary
        interface ICollection
        interface IEnumerable
    end
JScript does not support generic types or methods.

Type Parameters

  • TKey
    The type of the key.
  • TValue
    The type of the value.

The ReadOnlyDictionary<TKey, TValue> type exposes the following members.

Constructors

  Name Description
Public method ReadOnlyDictionary<TKey, TValue> Initializes a new instance of ReadOnlyDictionary.

Top

Properties

  Name Description
Public property Count Gets the number of items in the dictionary.
Public property Item Gets the value that is paired to the specified key.
Public property Keys Gets the collection of keys in the dictionary.
Public property Values Gets the collection of values in the dictionary.

Top

Methods

  Name Description
Public method ContainsKey Gets a flag that indicates that the specified key occurs in the dictionary.
Public method Equals 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 Gets an IEnumerator of the items in the dictionary.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method TryGetValue Gets the value that is paired with the specified key and stores it in value.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method ICollection<KeyValuePair<TKey, TValue>>.Add Adds the specified item to this dictionary.
Explicit interface implemetationPrivate method IDictionary<TKey, TValue>.Add Adds the specified key-value pair to this dictionary.
Explicit interface implemetationPrivate method IDictionary.Add Adds the specified key-value pair to this dictionary.
Explicit interface implemetationPrivate method ICollection<KeyValuePair<TKey, TValue>>.Clear Clears this dictionary.
Explicit interface implemetationPrivate method IDictionary.Clear Clears this dictionary.
Explicit interface implemetationPrivate method ICollection<KeyValuePair<TKey, TValue>>.Contains Checks whether the specified item is located in this dictionary.
Explicit interface implemetationPrivate method IDictionary.Contains Checks whether the specified key is located in this dictionary.
Explicit interface implemetationPrivate method ICollection<KeyValuePair<TKey, TValue>>.CopyTo Copies the contents of this dictionary to the specified array at the specified index.
Explicit interface implemetationPrivate method ICollection.CopyTo Copies the contents of this dictionary to the specified array, starting at the specified index.
Explicit interface implemetationPrivate property ICollection<KeyValuePair<TKey, TValue>>.Count Gets the number of items in this dictionary.
Explicit interface implemetationPrivate property ICollection.Count Returns the number of items in the dictionary.
Explicit interface implemetationPrivate method IDictionary.GetEnumerator Gets an enumerator instance of this dictionary.
Explicit interface implemetationPrivate method IEnumerable.GetEnumerator Gets an IEnumerator instance of this dictionary.
Explicit interface implemetationPrivate property IDictionary.IsFixedSize Returns true if the size of the dictionary will not change.
Explicit interface implemetationPrivate property ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly Gets a flag that describes whether this dictionary is read-only.
Explicit interface implemetationPrivate property IDictionary.IsReadOnly Returns true because this is a read-only dictionary.
Explicit interface implemetationPrivate property ICollection.IsSynchronized Returns true if the dictionary is synchronized.
Explicit interface implemetationPrivate property IDictionary<TKey, TValue>.Item Gets the value that is related to the specified key in this dictionary.
Explicit interface implemetationPrivate property IDictionary.Item Returns the value that is associated with the key in the dictionary.
Explicit interface implemetationPrivate property IDictionary.Keys Returns the collection of keys in this dictionary.
Explicit interface implemetationPrivate method ICollection<KeyValuePair<TKey, TValue>>.Remove Removes the specified item from this dictionary.
Explicit interface implemetationPrivate method IDictionary<TKey, TValue>.Remove Removes the item that has the specified key from this dictionary.
Explicit interface implemetationPrivate method IDictionary.Remove Removes the specified key from this dictionary.
Explicit interface implemetationPrivate property ICollection.SyncRoot Returns the root synchronization object for the dictionary, if one occurs.
Explicit interface implemetationPrivate property IDictionary.Values Returns the collection of values in this dictionary.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.TeamFoundation.Client Namespace