Dictionary<TKey,TValue>.KeyCollection コンストラクター

定義

指定したDictionary<TKey,TValue>.KeyCollection内のキーを反映するDictionary<TKey,TValue> クラスの新しいインスタンスを初期化します。

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

パラメーター

例外

dictionarynullです。

注釈

Dictionary<TKey,TValue>.KeyCollectionは静的コピーではありません。代わりに、Dictionary<TKey,TValue>.KeyCollectionは元のDictionary<TKey,TValue>のキーを参照します。 そのため、 Dictionary<TKey,TValue> への変更は引き続き Dictionary<TKey,TValue>.KeyCollectionに反映されます。

このコンストラクターは O(1) 操作です。

適用対象