Class IsolatedStorageSettings
Provides a System.Collections.Generic.Dictionary<TKey, TValue> that stores key-value pairs in isolated storage.
Inheritance
Implements
Inherited Members
Namespace: System.IO.IsolatedStorage
Assembly: OpenSilver.dll
Syntax
public sealed class IsolatedStorageSettings : IEnumerable<KeyValuePair<string, object>>, IEnumerable
Examples
Here is how to use the IsolatedStorageSettings:
//Write in the IsolatedStorageSettings:
IsolatedStorageSettings.ApplicationSettings["someKey"] = "someValue";
//Read from it:
string value;
string myString = IsolatedStorageSettings.ApplicationSettings.TryGetValue("someKey", out value);
Properties
| Improve this Doc View SourceApplicationSettings
Gets an instance of System.IO.IsolatedStorage.IsolatedStorageSettings that contains the contents of the application's System.IO.IsolatedStorage.IsolatedStorageFile, scoped at the application level, or creates a new instance of System.IO.IsolatedStorage.IsolatedStorageSettings if one does not exist.
Declaration
public static IsolatedStorageSettings ApplicationSettings { get; }
Property Value
Type | Description |
---|---|
IsolatedStorageSettings |
Count
Gets the number of key-value pairs that are stored in the dictionary.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Item[String]
Gets or sets the value associated with the specified key.
Declaration
public object this[string key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the item to get or set. |
Property Value
Type | Description |
---|---|
System.Object | The value associated with the specified key. If the specified key is not found, a get operation throws a System.Collections.Generic.KeyNotFoundException, and a set operation creates a new element that has the specified key. |
Keys
Gets a collection that contains the keys in the dictionary.
Declaration
public ICollection Keys { get; }
Property Value
Type | Description |
---|---|
System.Collections.ICollection |
SiteSettings
Declaration
[NotImplemented]
public static IsolatedStorageSettings SiteSettings { get; }
Property Value
Type | Description |
---|---|
IsolatedStorageSettings |
Values
Gets a collection that contains the values in the dictionary.
Declaration
public ICollection Values { get; }
Property Value
Type | Description |
---|---|
System.Collections.ICollection |
Methods
| Improve this Doc View SourceAdd(String, Object)
Adds an entry to the dictionary for the key-value pair.
Declaration
public void Add(string key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key for the entry to be stored. |
System.Object | value | The value to be stored. |
Clear()
Resets the count of items stored in System.IO.IsolatedStorage.IsolatedStorageSettings to zero and releases all references to elements in the collection.
Declaration
public void Clear()
Contains(String)
Determines if the application settings dictionary contains the specified key.
Declaration
public bool Contains(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key for the entry to be located. |
Returns
Type | Description |
---|---|
System.Boolean | true if the dictionary contains the specified key; otherwise, false. |
GetEnumerator()
Declaration
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String, System.Object>> |
Remove(String)
Removes the entry with the specified key.
Declaration
public bool Remove(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key for the entry to be deleted. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified key was removed; otherwise, false. |
Save()
Declaration
[NotImplemented]
public void Save()
TryGetValue<T>(String, out T)
Gets a value for the specified key.
Declaration
public bool TryGetValue<T>(string key, out T value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the value to get. |
T | value | When this method returns, the value associated with the specified key if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified key is found; otherwise, false. |
Type Parameters
Name | Description |
---|---|
T | The System.Type of the value parameter. |
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |