public sealed class Dictionary<TKey,TValue>.ValueCollection: ICollection<TKey>, IEnumerable<TKey>, ICollection, IEnumerable
Object
Dictionary<TKey,TValue>.ValueCollectionThis type implements ICollection, IEnumerable, System.Collections.Generic.ICollection<TKey>, and System.Collections.Generic.IEnumerable<TKey>.
mscorlib
BCL
Represents a read-only collection of values in a dictionary.
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.
System.Collections.Generic Namespace
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
public ValueCollection(Dictionary<TKey,TValue> dictionary)
Initializes a new value collection to reflect the values from the specified dictionary.
- dictionary
- The dictionary whose values are to be reflected in the value collection.
Exception Type Condition ArgumentNullException dictionary is null
.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
public void CopyTo(TValue[] array, int arrayIndex)
Copies the elements of the value collection to a Array, starting at a particular index.
- 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.
Exception Type Condition ArgumentException array 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.
ArgumentNullException array is null
.
ArgumentOutOfRangeException arrayIndex < 0.
The elements are copied into the array in the same order in which the enumerator iterates through the value collection.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
public Dictionary<TKey,TValue>.ValueCollection.Enumerator GetEnumerator()
Returns an enumerator that can be used to iterate over the value collection.
An enumerator for the value collection.
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>.]
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
void ICollection<TValue>.Add(TValue item)
This method is implemented to support the System.Collections.Generic.ICollection<TValue> interface. This method throws an exception of type NotSupportedException.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
void ICollection<TValue>.Clear()
This method is implemented to support the System.Collections.Generic.ICollection<TValue> interface. This method throws an exception of type NotSupportedException.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
bool ICollection<TValue>.Contains(TValue item)
This method is implemented to support the System.Collections.Generic.ICollection<TValue> interface.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
bool ICollection<TValue>.Remove(TValue item)
This method is implemented to support the System.Collections.Generic.ICollection<TValue> interface. This method throws an exception of type NotSupportedException.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
IEnumerator<TValue> IEnumerable<TValue>.GetEnumerator()
This method is implemented to support the System.Collections.Generic.IEnumerable<TValue> interface.
If the underlying dictionary is modified, or the value of any key in that dictionary is modified, the behavior of the enumerator is unspecified.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
void ICollection.CopyTo(Array array, int index)
This method is implemented to support the ICollection interface.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
IEnumerator IEnumerable.GetEnumerator()
This method is implemented to support the IEnumerable interface.
If the underlying dictionary is modified, or the value of any key in that dictionary is modified, the behavior of the enumerator is unspecified.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
public int Count { get; }
Gets the number of elements contained in the value collection.
The number of elements in the value collection.
This property is read-only.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
bool ICollection<TValue>.IsReadOnly { get; }
This read-only property is implemented to support the System.Collections.Generic.ICollection<TValue> interface. This property returns true.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
bool ICollection.IsSynchronized { get; }
This read-only property is implemented to support the ICollection interface. This property returns false.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace
object ICollection.SyncRoot { get; }
This property is implemented to support the ICollection interface.
This read-only property returns theSyncRoot
property of the underlying dictionary.
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection Class, System.Collections.Generic Namespace