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
-
ICollection<TKey>IReadOnlyCollection<TKey>IEnumerable<TKey>
- 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
dictionarySwiftDictionary<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
Methods
CopyTo(TKey[], int)
public void CopyTo(TKey[] array, int arrayIndex)
Parameters
arrayTKey[]arrayIndexint
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.