ApplicationDataCompositeValue Class
Représente les paramètres d'application associés qui doivent être sérialisés et désérialisés de façon atomique.
Syntaxe
var applicationDataCompositeValue = new Windows.Storage.ApplicationDataCompositeValue();
Attributs
- ActivatableAttribute(NTDDI_WIN8)
- DualApiPartitionAttribute()
- MarshalingBehaviorAttribute(Agile)
- ThreadingAttribute(MTA)
- VersionAttribute(NTDDI_WIN8)
Membres
ApplicationDataCompositeValueClasse comporte les types de membres suivants :
Constructeurs
ApplicationDataCompositeValueClasse comporte les constructeurs suivants.
| Constructeur | Description |
|---|---|
| ApplicationDataCompositeValue | Creates and initializes a new, initially empty, instance of the object. |
Événements
ApplicationDataCompositeValueClasse comporte les événements suivants.
| Événement | Description |
|---|---|
| MapChanged | Occurs when the map changes. |
Méthodes
The ApplicationDataCompositeValue Classe comporte les méthodes suivantes. Avec C#, Visual Basic et C++, il hérite également des méthodes de Object Classe.
| Méthode | Description |
|---|---|
| Add(KeyValuePair) | Adds a new key-value pair to the ApplicationDataCompositeValue. |
| Add(String) | Adds an item to the ApplicationDataCompositeValue. |
| Clear | Removes all application settings previously inserted into the composite value object, returning the object to its empty state. |
| Contains | Returns a value that indicates whether a specified key-value pair exists in the ApplicationDataCompositeValue. |
| ContainsKey | Returns a value that indicates whether a specified key exists in the ApplicationDataCompositeValue. |
| CopyTo | Copies the elements of the collection to an array, starting at a particular array index. |
| First | Retrieves an iterator to enumerate the settings in the composite value. |
| GetView | Returns a read-only snapshot of the contents of the composite value. |
| HasKey | Determines whether there is an application setting with the specified key. |
| Insert | Creates or replaces an application setting. |
| Lookup | Retrieves the specified application setting. |
| Remove | Removes the specified application setting. |
| Remove(KeyValuePair) | Removes a specific key-value pair from the ApplicationDataCompositeValue. |
| Remove(String) | Removes a specific item from the ApplicationDataCompositeValue. |
| TryGetValue | Returns a value that indicates whether a specified key exists in the ApplicationDataCompositeValue. If an item with that key exists, the item is retrieved as an out parameter. |
Propriétés
Le ApplicationDataCompositeValueClasse contient les propriétés suivantes.
| Propriété | Type d’accès | Description |
|---|---|---|
| en lecture seule | Gets the number of elements contained in the collection. | |
| en lecture seule | Gets a value indicating whether the dictionary is read-only. | |
| en lecture/écriture | Gets or sets the element value at the specified key index. | |
| en lecture seule | Gets an ICollection object containing the keys of the ApplicationDataCompositeValue. | |
| en lecture seule | Gets the number of related application settings. | |
| en lecture seule | Gets an ICollection object containing the values of the ApplicationDataCompositeValue . |
Remarques
Une configuration composite est sérialisée par insertion dans un mappage de paramètres et désérialisation en effectuant une recherche à partir du mappage.
Liste des membres de la collection
En JavaScript, ApplicationDataCompositeValue prend en charge l'utilisation d'un index pour accéder aux éléments.
Exemples
Cet exemple crée et lit une configuration composite nommée exampleCompositeSetting.
Appelle la méthode Remove | remove pour supprimer le paramètre exampleCompositeSetting lorsque vous n'en avez plus besoin.
var applicationData = Windows.Storage.ApplicationData.current; var localSettings = applicationData.localSettings; // Create a composite setting var composite = new Windows.Storage.ApplicationDataCompositeValue(); composite["intVal"] = 1; composite["strVal"] = "string"; localSettings.values["exampleCompositeSetting"] = composite; // Read data from a composite setting var composite = localSettings.values["exampleCompositeSetting"]; if (!composite) { // No data } else { // Access data in composite["intVal"] and composite["strVal"] } // Delete a composite setting localSettings.values.remove("exampleCompositeSetting");
Configuration requise
|
Client minimal pris en charge | Windows 8 [Applications du Windows Store, applications de bureau] |
|---|---|
|
Serveur minimal pris en charge | Windows Server 2012 [Applications du Windows Store, applications de bureau] |
|
Espace de noms |
|
|
Métadonnées |
|
|
DLL |
|
Voir aussi
- Tâches
- Démarrage rapide : données des applications locales (JavaScript)
- Démarrage rapide : données des applications locales (C#/VB/C++)
- Démarrage rapide : données d'application itinérantes (JavaScript)
- Démarrage rapide : données d'application itinérantes (C#/VB/C++)
- Concepts
- Présentation des données de l'application
- Référence
- ApplicationData
- ApplicationDataContainer
- ApplicationDataContainerSettings
- Exemples
- Exemple de données d'application
