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))

パラメーター

dictionary
Dictionary<TKey,TValue>

新しい Dictionary<TKey,TValue> にキーが反映される Dictionary<TKey,TValue>.KeyCollection

例外

dictionarynullです。

注釈

Dictionary<TKey,TValue>.KeyCollectionは静的コピーではありません。代わりに、 Dictionary<TKey,TValue>.KeyCollection は元Dictionary<TKey,TValue>の のキーを参照します。 したがって、 に対する Dictionary<TKey,TValue> 変更は、 に Dictionary<TKey,TValue>.KeyCollection反映され続けます。

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

適用対象