Dictionary<TKey,TValue>.KeyCollection Construtor
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Inicializa uma nova instância da Dictionary<TKey,TValue>.KeyCollection classe que reflete as chaves no .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))
Parâmetros
- dictionary
- Dictionary<TKey,TValue>
Cujas Dictionary<TKey,TValue> chaves estão refletidas no novo Dictionary<TKey,TValue>.KeyCollection.
Exceções
dictionary é null.
Observações
O Dictionary<TKey,TValue>.KeyCollection não é uma cópia estática; em vez disso, o Dictionary<TKey,TValue>.KeyCollection refere-se às chaves no original Dictionary<TKey,TValue>. Portanto, as alterações ao Dictionary<TKey,TValue> continuam a ser refletidas no Dictionary<TKey,TValue>.KeyCollection.
Este construtor é uma operação O(1).