SortedDictionary<TKey,TValue>.KeyCollection 构造函数

定义

初始化 SortedDictionary<TKey,TValue>.KeyCollection 类的新实例,该实例反映指定的 SortedDictionary<TKey,TValue> 中的键。

public:
 KeyCollection(System::Collections::Generic::SortedDictionary<TKey, TValue> ^ dictionary);
public KeyCollection (System.Collections.Generic.SortedDictionary<TKey,TValue> dictionary);
new System.Collections.Generic.SortedDictionary<'Key, 'Value>.KeyCollection : System.Collections.Generic.SortedDictionary<'Key, 'Value> -> System.Collections.Generic.SortedDictionary<'Key, 'Value>.KeyCollection
Public Sub New (dictionary As SortedDictionary(Of TKey, TValue))

参数

例外

dictionarynull

注解

这不是 SortedDictionary<TKey,TValue>.KeyCollection 静态副本;相反,引用 SortedDictionary<TKey,TValue>.KeyCollection 原始 SortedDictionary<TKey,TValue>副本中的键。 因此,继续反映对更改的SortedDictionary<TKey,TValue>.KeyCollection更改SortedDictionary<TKey,TValue>

此构造函数是 O (1) 操作。

适用于