Table of Contents

Class SwiftDictionary<TKey, TValue>.KeyCollection

Namespace
SwiftCollections
Assembly
SwiftCollections.dll

Provides a dynamic, read-only collection of all keys in the dictionary, supporting enumeration and copy operations.

public sealed class SwiftDictionary<TKey, TValue>.KeyCollection : ICollection<TKey>, ICollection, IReadOnlyCollection<TKey>, IEnumerable<TKey>, IEnumerable
Inheritance
SwiftDictionary<TKey, TValue>.KeyCollection
Implements
Inherited Members
Extension Methods

Constructors

KeyCollection(SwiftDictionary<TKey, TValue>)

Initializes a new instance of the KeyCollection class that reflects the keys in the specified dictionary.

public KeyCollection(SwiftDictionary<TKey, TValue> dictionary)

Parameters

dictionary SwiftDictionary<TKey, TValue>

The dictionary whose keys are reflected in the new KeyCollection.

Exceptions

ArgumentNullException

The dictionary is null.

Properties

Count

public int Count { get; }

Property Value

int

Methods

CopyTo(TKey[], int)

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

Parameters

array TKey[]
arrayIndex int

GetEnumerator()

Returns an enumerator that iterates through the keys in the collection.

public SwiftDictionary<TKey, TValue>.KeyCollection.KeyCollectionEnumerator GetEnumerator()

Returns

SwiftDictionary<TKey, TValue>.KeyCollection.KeyCollectionEnumerator

An enumerator for the keys in the collection.