SynchronizedKeyedCollection<K,T> Constructeurs
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Initialise une nouvelle instance de la classe SynchronizedKeyedCollection<K,T>.
Surcharges
| Nom | Description |
|---|---|
| SynchronizedKeyedCollection<K,T>() |
Initialise une nouvelle instance de la classe SynchronizedKeyedCollection<K,T>. |
| SynchronizedKeyedCollection<K,T>(Object) |
Initialise une nouvelle instance de la SynchronizedKeyedCollection<K,T> classe avec accès synchronisé par un objet spécifié explicitement. |
| SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>) |
Initialise une nouvelle instance de la SynchronizedKeyedCollection<K,T> classe avec accès synchronisé par un objet spécifié explicitement et avec des clés comparées de manière spécifiée. |
| SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>, Int32) |
Initialise une nouvelle instance de la SynchronizedKeyedCollection<K,T> classe avec accès synchronisé par un objet spécifié explicitement et avec des clés comparées de manière spécifiée. |
SynchronizedKeyedCollection<K,T>()
Initialise une nouvelle instance de la classe SynchronizedKeyedCollection<K,T>.
protected:
SynchronizedKeyedCollection();
protected SynchronizedKeyedCollection();
Protected Sub New ()
S’applique à
SynchronizedKeyedCollection<K,T>(Object)
Initialise une nouvelle instance de la SynchronizedKeyedCollection<K,T> classe avec accès synchronisé par un objet spécifié explicitement.
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)
Paramètres
- syncRoot
- Object
Objet utilisé pour synchroniser l’accès à la collection thread-safe.
Exceptions
syncRoot a la valeur null.
Remarques
Si plusieurs instances du fichier SynchronizedKeyedCollection<K,T> sont créées à l’aide du même syncRootélément, l’accès est protégé sur toutes les instances.
S’applique à
SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>)
Initialise une nouvelle instance de la SynchronizedKeyedCollection<K,T> classe avec accès synchronisé par un objet spécifié explicitement et avec des clés comparées de manière spécifiée.
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))
Paramètres
- syncRoot
- Object
Objet utilisé pour synchroniser l’accès à la collection thread-safe.
- comparer
- IEqualityComparer<K>
Type IEqualityComparer<T>K utilisé pour comparer les objets clés de type K pour l’égalité.
Exceptions
syncRoot est null ou comparer est null.
Remarques
Le paramètre K générique utilisé par le IEqualityComparer<T> paramètre d’entrée est le premier paramètre générique pour cette classe. Cela nous permet de comparer les clés d’égalité d’une manière personnalisée qui peut être utilisée, par exemple, pour optimiser les aspects les plus critiques de la comparaison.
S’applique à
SynchronizedKeyedCollection<K,T>(Object, IEqualityComparer<K>, Int32)
Initialise une nouvelle instance de la SynchronizedKeyedCollection<K,T> classe avec accès synchronisé par un objet spécifié explicitement et avec des clés comparées de manière spécifiée.
protected:
SynchronizedKeyedCollection(System::Object ^ syncRoot, System::Collections::Generic::IEqualityComparer<K> ^ comparer, int dictionaryCreationThreshold);
protected SynchronizedKeyedCollection(object syncRoot, System.Collections.Generic.IEqualityComparer<K> comparer, int dictionaryCreationThreshold);
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)
Paramètres
- syncRoot
- Object
Objet utilisé pour synchroniser l’accès à la collection thread-safe.
- comparer
- IEqualityComparer<K>
Type IEqualityComparer<T>K utilisé pour comparer les objets clés de type K pour l’égalité.
- dictionaryCreationThreshold
- Int32
Nombre d’éléments requis pour créer un dictionnaire pour la collection.
Exceptions
syncRoot est null ou comparer est null.
dictionaryCreationThreshold est inférieur à -1.
Remarques
La définition dictionaryCreationThreshold de -1 lui affecte ( MaxValue 2 147 483 647 ; 0x7FFFFFFF hexadécimal).