Interface ILocalStorage
Represents the local storage for the site currently opened in the browser. Each site has its own separate storage area.
public interface ILocalStorage
Properties
Count
Gets the number of items in local storage.
int Count { get; }
Property Value
Methods
Clear()
Clears local storage.
void Clear()
GetItem(string)
Returns value of the local storage given a key.
string GetItem(string key)
Parameters
key
stringkey to for a local storage entry
Returns
KeySet()
Returns the set of keys associated with local storage.
ReadOnlyCollection<string> KeySet()
Returns
- ReadOnlyCollection<string>
Returns the set of keys associated with local storage as HashSet<T>.
RemoveItem(string)
Removes key/value pair from local storage.
string RemoveItem(string key)
Parameters
key
stringkey to remove from storage
Returns
SetItem(string, string)
Adds key/value pair to local storage.
void SetItem(string key, string value)