System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class

public sealed class Dictionary<TKey,TValue>.ValueCollection: ICollection<TKey>, IEnumerable<TKey>, ICollection, IEnumerable

Base Types

Object
  Dictionary<TKey,TValue>.ValueCollection

This type implements ICollection, IEnumerable, System.Collections.Generic.ICollection<TKey>, and System.Collections.Generic.IEnumerable<TKey>.

Assembly

mscorlib

Library

BCL

Summary

Represents a read-only collection of values in a dictionary.

Description

The System.Collections.Generic.Dictionary<TKey,TValue>.Values property returns an instance of this type, containing all the values in that dictionary. The order of the values in the value collection is unspecified, but it is the same order as the associated values in the key collection returned by the System.Collections.Generic.Dictionary<TKey,TValue>.Keys property.

If the underlying dictionary is modified, or the value of any key in that dictionary is modified, the behavior of the value collection is unspecified.

See Also

System.Collections.Generic Namespace

Members

Dictionary<TKey,TValue>.ValueCollection Constructors

Dictionary<TKey,TValue>.ValueCollection Constructor

Dictionary<TKey,TValue>.ValueCollection Methods

Dictionary<TKey,TValue>.ValueCollection.CopyTo Method
Dictionary<TKey,TValue>.ValueCollection.GetEnumerator Method
Dictionary<TKey,TValue>.ValueCollection.System.Collections.Generic.ICollection<TValue>.Add Method
Dictionary<TKey,TValue>.ValueCollection.System.Collections.Generic.ICollection<TValue>.Clear Method
Dictionary<TKey,TValue>.ValueCollection.System.Collections.Generic.ICollection<TValue>.Contains Method
Dictionary<TKey,TValue>.ValueCollection.System.Collections.Generic.ICollection<TValue>.Remove Method
Dictionary<TKey,TValue>.ValueCollection.System.Collections.Generic.IEnumerable<TValue>.GetEnumerator Method
Dictionary<TKey,TValue>.ValueCollection.System.Collections.ICollection.CopyTo Method
Dictionary<TKey,TValue>.ValueCollection.System.Collections.IEnumerable.GetEnumerator Method

Dictionary<TKey,TValue>.ValueCollection Properties

Dictionary<TKey,TValue>.ValueCollection.Count Property
Dictionary<TKey,TValue>.ValueCollection.System.Collections.Generic.ICollection<TValue>.IsReadOnly Property
Dictionary<TKey,TValue>.ValueCollection.System.Collections.ICollection.IsSynchronized Property
Dictionary<TKey,TValue>.ValueCollection.System.Collections.ICollection.SyncRoot Property


Dictionary<TKey,TValue>.ValueCollection Constructor

public ValueCollection(Dictionary<TKey,TValue> dictionary)

Summary

Initializes a new value collection to reflect the values from the specified dictionary.

Parameters

dictionary
The dictionary whose values are to be reflected in the value collection.

Exceptions

Exception TypeCondition
ArgumentNullExceptiondictionary is null .

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.CopyTo Method

public void CopyTo(TValue[] array, int arrayIndex)

Summary

Copies the elements of the value collection to a Array, starting at a particular index.

Parameters

array
A one-dimensional, zero-based Array that is the destination of the elements copied from the value collection.
arrayIndex
The zero-based index in array at which copying begins.

Exceptions

Exception TypeCondition
ArgumentExceptionarray is multidimensional.

-or-

array does not have zero-based indexing.

-or-

arrayIndex is greater than the length of array.

-or-

The number of elements in the value collection is greater than the available space from arrayIndex to the end of the destination array.

-or-

Some element of the value collection is not assignable to the element type of the array.

ArgumentNullExceptionarray is null .

ArgumentOutOfRangeExceptionarrayIndex < 0.

Description

The elements are copied into the array in the same order in which the enumerator iterates through the value collection.

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.GetEnumerator Method

public Dictionary<TKey,TValue>.ValueCollection.Enumerator GetEnumerator()

Summary

Returns an enumerator that can be used to iterate over the value collection.

Return Value

An enumerator for the value collection.

Description

If the underlying dictionary is modified, or the value of any key in that dictionary is modified, the behavior of the enumerator is unspecified.

[Usage: For a detailed description regarding the use of an enumerator, see System.Collections.Generic.IEnumerator<TKey>.]

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.System.Collections.Generic.ICollection<TValue>.Add Method

void ICollection<TValue>.Add(TValue item)

Summary

This method is implemented to support the System.Collections.Generic.ICollection<TValue> interface. This method throws an exception of type NotSupportedException.

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.System.Collections.Generic.ICollection<TValue>.Clear Method

void ICollection<TValue>.Clear()

Summary

This method is implemented to support the System.Collections.Generic.ICollection<TValue> interface. This method throws an exception of type NotSupportedException.

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.System.Collections.Generic.ICollection<TValue>.Contains Method

bool ICollection<TValue>.Contains(TValue item)

Summary

This method is implemented to support the System.Collections.Generic.ICollection<TValue> interface.

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.System.Collections.Generic.ICollection<TValue>.Remove Method

bool ICollection<TValue>.Remove(TValue item)

Summary

This method is implemented to support the System.Collections.Generic.ICollection<TValue> interface. This method throws an exception of type NotSupportedException.

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.System.Collections.Generic.IEnumerable<TValue>.GetEnumerator Method

IEnumerator<TValue> IEnumerable<TValue>.GetEnumerator()

Summary

This method is implemented to support the System.Collections.Generic.IEnumerable<TValue> interface.

Description

If the underlying dictionary is modified, or the value of any key in that dictionary is modified, the behavior of the enumerator is unspecified.

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.System.Collections.ICollection.CopyTo Method

void ICollection.CopyTo(Array array, int index)

Summary

This method is implemented to support the ICollection interface.

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.System.Collections.IEnumerable.GetEnumerator Method

IEnumerator IEnumerable.GetEnumerator()

Summary

This method is implemented to support the IEnumerable interface.

Description

If the underlying dictionary is modified, or the value of any key in that dictionary is modified, the behavior of the enumerator is unspecified.

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.Count Property

public int Count { get; }

Summary

Gets the number of elements contained in the value collection.

Property Value

The number of elements in the value collection.

Description

This property is read-only.

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.System.Collections.Generic.ICollection<TValue>.IsReadOnly Property

bool ICollection<TValue>.IsReadOnly { get; }

Summary

This read-only property is implemented to support the System.Collections.Generic.ICollection<TValue> interface. This property returns true.

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.System.Collections.ICollection.IsSynchronized Property

bool ICollection.IsSynchronized { get; }

Summary

This read-only property is implemented to support the ICollection interface. This property returns false.

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace

Dictionary<TKey,TValue>.ValueCollection.System.Collections.ICollection.SyncRoot Property

object ICollection.SyncRoot { get; }

Summary

This property is implemented to support the ICollection interface.

Description

This read-only property returns the SyncRoot property of the underlying dictionary.

See Also

System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace