Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
Tradução
Original
Este tópico ainda não foi avaliado como - Avalie este tópico

Dictionary<TKey, TValue>.KeyCollection Classe

Represents the collection of keys in a Dictionary<TKey, TValue>. Esta classe não pode ser herdada.

Namespace:  System.Collections.Generic
Assembly:  mscorlib (em mscorlib. dll)
[SerializableAttribute]
public sealed class KeyCollection : ICollection<TKey>, 
	IEnumerable<TKey>, ICollection, IEnumerable

The Dictionary<TKey, TValue>.Keys property returns an instance of this type, containing all the keys in that Dictionary<TKey, TValue>.The order of the keys in the Dictionary<TKey, TValue>.KeyCollection is unspecified, but it is the same order as the associated values in the Dictionary<TKey, TValue>.ValueCollection returned by the Dictionary<TKey, TValue>.Values property.

The Dictionary<TKey, TValue>.KeyCollection is not a static copy; instead, the Dictionary<TKey, TValue>.KeyCollection refers back to the keys in the original Dictionary<TKey, TValue>.Therefore, changes to the Dictionary<TKey, TValue> continue to be reflected in the Dictionary<TKey, TValue>.KeyCollection.

System.Object
  System.Collections.Generic.Dictionary<TKey, TValue>.KeyCollection

Public static (Shared in Visual Basic) members of this type are thread safe. Os membros da instâncianão estãogarantias de serem thread safe.

A Dictionary<TKey, TValue>.KeyCollection can support multiple readers concurrently, as long as the collection is not modified.Even SO, enumerating Através a coleção intrinsically not is a procedimento thread-safe.Para garantir segurança de segmentos durante enumeração, você pode bloquear a coleção durante toda a enumeração.Para permitir que a coleção seja acessada por vários segmentos de leitura e gravação, você deve implementar sua sincronização.

Isso foi útil para você?
(1500 caracteres restantes)

Contribuições da comunidade

ADICIONAR
© 2013 Microsoft. Todos os direitos reservados.