SynchronizedKeyedCollection<K,T> Construtores

Definição

Inicializa uma nova instância da classe SynchronizedKeyedCollection<K,T>.Initializes a new instance of the SynchronizedKeyedCollection<K,T> class.

Sobrecargas

SynchronizedKeyedCollection<K,T>()

Inicializa uma nova instância da classe SynchronizedKeyedCollection<K,T>.Initializes a new instance of the SynchronizedKeyedCollection<K,T> class.

SynchronizedKeyedCollection<K,T>(Object)

Inicializa uma nova instância da classe SynchronizedKeyedCollection<K,T> com acesso sincronizado por um objeto especificado explicitamente.Initializes a new instance of the SynchronizedKeyedCollection<K,T> class with access synchronized by an explicitly specified object.

SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>)

Inicializa uma nova instância da classe SynchronizedKeyedCollection<K,T> com acesso sincronizado por um objeto explicitamente especificado e com chaves comparadas de uma forma especificada.Initializes a new instance of the SynchronizedKeyedCollection<K,T> class with access synchronized by an explicitly specified object and with keys compared in a specified way.

SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>, Int32)

Inicializa uma nova instância da classe SynchronizedKeyedCollection<K,T> com acesso sincronizado por um objeto explicitamente especificado e com chaves comparadas de uma forma especificada.Initializes a new instance of the SynchronizedKeyedCollection<K,T> class with access synchronized by an explicitly specified object and with keys compared in a specified way.

SynchronizedKeyedCollection<K,T>()

Inicializa uma nova instância da classe SynchronizedKeyedCollection<K,T>.Initializes a new instance of the SynchronizedKeyedCollection<K,T> class.

protected:
 SynchronizedKeyedCollection();
protected SynchronizedKeyedCollection ();
Protected Sub New ()

Aplica-se a

SynchronizedKeyedCollection<K,T>(Object)

Inicializa uma nova instância da classe SynchronizedKeyedCollection<K,T> com acesso sincronizado por um objeto especificado explicitamente.Initializes a new instance of the SynchronizedKeyedCollection<K,T> class with access synchronized by an explicitly specified object.

protected:
 SynchronizedKeyedCollection(System::Object ^ syncRoot);
protected SynchronizedKeyedCollection (object syncRoot);
new System.Collections.Generic.SynchronizedKeyedCollection<'K, 'T> : obj -> System.Collections.Generic.SynchronizedKeyedCollection<'K, 'T>
Protected Sub New (syncRoot As Object)

Parâmetros

syncRoot
Object

O objeto usado para sincronizar o acesso à coleção thread-safe.The object used to synchronize access to the thread-safe collection.

Exceções

syncRoot é null.syncRoot is null.

Comentários

Se várias instâncias do SynchronizedKeyedCollection<K,T> forem criadas usando o mesmo syncRoot , o acesso será protegido em todas as instâncias.If multiple instances of the SynchronizedKeyedCollection<K,T> are created using the same syncRoot, then access is protected across all instances.

Aplica-se a

SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>)

Inicializa uma nova instância da classe SynchronizedKeyedCollection<K,T> com acesso sincronizado por um objeto explicitamente especificado e com chaves comparadas de uma forma especificada.Initializes a new instance of the SynchronizedKeyedCollection<K,T> class with access synchronized by an explicitly specified object and with keys compared in a specified way.

protected:
 SynchronizedKeyedCollection(System::Object ^ syncRoot, System::Collections::Generic::IEqualityComparer<K> ^ comparer);
protected SynchronizedKeyedCollection (object syncRoot, System.Collections.Generic.IEqualityComparer<K> comparer);
new System.Collections.Generic.SynchronizedKeyedCollection<'K, 'T> : obj * System.Collections.Generic.IEqualityComparer<'K> -> System.Collections.Generic.SynchronizedKeyedCollection<'K, 'T>
Protected Sub New (syncRoot As Object, comparer As IEqualityComparer(Of K))

Parâmetros

syncRoot
Object

O objeto usado para sincronizar o acesso à coleção thread-safe.The object used to synchronize access to the thread-safe collection.

comparer
IEqualityComparer<K>

O IEqualityComparer<T> do tipo K usado para comparar a igualdade de objetos chave do tipo K.The IEqualityComparer<T> of type K used to compare key objects of type K for equality.

Exceções

O syncRoot é null ou o comparer é null.syncRoot is null or comparer is null.

Comentários

O parâmetro genérico K usado pelo IEqualityComparer<T> parâmetro de entrada é o primeiro parâmetro genérico para essa classe.The generic parameter K used by the IEqualityComparer<T> input parameter is the first generic parameter for this class. Isso nos permite comparar as chaves de igualdade de uma maneira personalizada que pode ser usada, por exemplo, para otimizar os aspectos mais críticos da comparação.This allows us to compare keys for equality in a customized way that can be used, for example, to optimize on the most critical aspects of the comparison.

Aplica-se a

SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>, Int32)

Inicializa uma nova instância da classe SynchronizedKeyedCollection<K,T> com acesso sincronizado por um objeto explicitamente especificado e com chaves comparadas de uma forma especificada.Initializes a new instance of the SynchronizedKeyedCollection<K,T> class with access synchronized by an explicitly specified object and with keys compared in a specified way.

protected:
 SynchronizedKeyedCollection(System::Object ^ syncRoot, System::Collections::Generic::IEqualityComparer<K> ^ comparer, int dictionaryCreationThreshold);
protected:
 SynchronizedKeyedCollection(System::Object ^ syncRoot, System::Collections::Generic::IEqualityComparer<K> ^ comparer, int capacity);
protected SynchronizedKeyedCollection (object syncRoot, System.Collections.Generic.IEqualityComparer<K> comparer, int dictionaryCreationThreshold);
protected SynchronizedKeyedCollection (object syncRoot, System.Collections.Generic.IEqualityComparer<K> comparer, int capacity);
new System.Collections.Generic.SynchronizedKeyedCollection<'K, 'T> : obj * System.Collections.Generic.IEqualityComparer<'K> * int -> System.Collections.Generic.SynchronizedKeyedCollection<'K, 'T>
new System.Collections.Generic.SynchronizedKeyedCollection<'K, 'T> : obj * System.Collections.Generic.IEqualityComparer<'K> * int -> System.Collections.Generic.SynchronizedKeyedCollection<'K, 'T>
Protected Sub New (syncRoot As Object, comparer As IEqualityComparer(Of K), dictionaryCreationThreshold As Integer)
Protected Sub New (syncRoot As Object, comparer As IEqualityComparer(Of K), capacity As Integer)

Parâmetros

syncRoot
Object

O objeto usado para sincronizar o acesso à coleção thread-safe.The object used to synchronize access to the thread-safe collection.

comparer
IEqualityComparer<K>

O IEqualityComparer<T> do tipo K usado para comparar a igualdade de objetos chave do tipo K.The IEqualityComparer<T> of type K used to compare key objects of type K for equality.

dictionaryCreationThresholdcapacity
Int32

O número de itens necessários para criar um dicionário para a coleção.The number of items required to create a dictionary for the collection.

Exceções

O syncRoot é null ou o comparer é null.syncRoot is null or comparer is null.

dictionaryCreationThreshold é menor que -1.dictionaryCreationThreshold is less than -1.

Comentários

A configuração dictionaryCreationThreshold para-1 atribui o MaxValue (2.147.483.647; hexadecimal 0x7FFFFFFF) a ele.Setting dictionaryCreationThreshold to -1 assigns the MaxValue (2,147,483,647; hexadecimal 0x7FFFFFFF) to it.

Aplica-se a