Provides access to the settings in a settings container.
Syntax
public ref class ApplicationDataContainerSettings sealed : Object, IPropertySet, IObservableMap<String, Object>, IMap<String, Object>, IIterable<IKeyValuePair>
Attributes
- DualApiPartitionAttribute()
- MarshalingBehaviorAttribute(Agile)
- VersionAttribute(NTDDI_WIN8)
Members
The ApplicationDataContainerSettings class has these types of members:
Events
The ApplicationDataContainerSettings class has these events.
| Event | Description |
|---|---|
| MapChanged | Occurs when the map changes. |
Methods
The ApplicationDataContainerSettings class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| Add(KeyValuePair) [C#, VB] | Adds a new key-value pair to the ApplicationDataContainerSettings. |
| Add(String) [C#, VB] | Adds an item to the ApplicationDataContainerSettings. |
| Clear | Removes all related application settings. |
| Contains [C#, VB] | Returns a value that indicates whether a specified key-value pair exists in the ApplicationDataContainerSettings. |
| ContainsKey [C#, VB] | Returns a value that indicates whether a specified key exists in the ApplicationDataContainerSettings. |
| CopyTo [C#, VB] | Copies the elements of the collection to an array, starting at a particular array index. |
| First [C++, JavaScript] | Retrieves an iterator to enumerate the settings in the settings container. |
| GetView [C++, JavaScript] | Returns a read-only snapshot of the contents of the settings container. |
| HasKey [C++, JavaScript] | Determines whether there is an application setting with the specified key. |
| Insert [C++, JavaScript] | Inserts or replaces an application setting. |
| Lookup [C++, JavaScript] | Retrieves the specified application setting. |
| Remove [C++, JavaScript] | Removes the specified application setting. |
| Remove(KeyValuePair) [C#, VB] | Removes a specific key-value pair from the ApplicationDataContainerSettings. |
| Remove(String) [C#, VB] | Removes a specific item from the ApplicationDataContainerSettings. |
| TryGetValue [C#, VB] | Returns a value that indicates whether a specified key exists in the ApplicationDataContainerSettings. If an item with that key exists, the item is retrieved as an out parameter. |
Properties
The ApplicationDataContainerSettings class has these properties.
| Property | Access type | Description |
|---|---|---|
|
Count [C#, VB] | Read-only | Gets the number of elements contained in the collection. |
|
IsReadOnly [C#, VB] | Read-only | Gets a value indicating whether the dictionary is read-only. |
|
Item [C#, VB] | Read/write | Gets or sets the element value at the specified key index. |
|
Keys [C#, VB] | Read-only | Gets an ICollection object containing the keys of the ApplicationDataContainerSettings. |
|
Size [C++, JavaScript] | Read-only | Gets the number of related application settings. |
|
Values [C#, VB] | Read-only | Gets an ICollection object containing the values of the ApplicationDataContainerSettings . |
Remarks
Collection member lists
For JavaScript, ApplicationDataContainerSettings supports using an index to access items.
Examples
Use the LocalSettings | localSettings property to get the settings in an ApplicationDataContainer object. Use the ApplicationDataContainer.Values | values property to access the settings in the localSettings container. This example creates and reads a setting named exampleSetting.
Call the ApplicationDataContainerSettings.Remove | remove method to delete the exampleSetting setting when you have finished with it.
ApplicationDataContainer^ localSettings = ApplicationData::Current->LocalSettings; // Create a simple setting auto values = localSettings->Values; values->Insert("exampleSetting", dynamic_cast<PropertyValue^>(PropertyValue::CreateString("Hello Windows"))); // Read data from a simple setting auto values = localSettings->Values; String^ value = safe_cast<String^>(localSettings->Values->Lookup("exampleSetting")); if (!value) { // No data } else { // Access data in value } // Delete a simple setting values->Remove("exampleSetting");
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps, desktop apps] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps, desktop apps] |
|
Namespace |
|
|
Metadata |
|
|
DLL |
|
See also
- Tasks
- Quickstart: Local application data (JavaScript)
- Quickstart: Local application data (C#/VB/C++)
- Quickstart: Roaming application data (JavaScript)
- Quickstart: Roaming application data (C#/VB/C++)
- Concepts
- Application data overview
- Reference
- ApplicationData
- ApplicationDataCompositeValue
- ApplicationDataContainer
- Samples
- Application data sample
Build date: 2/25/2013