ApplicationDataStorageHelper Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An extension of ApplicationDataStorageHelper with additional features for interop with the LocalCacheFolder.
public class ApplicationDataStorageHelper : Microsoft.Toolkit.Helpers.IFileStorageHelper, Microsoft.Toolkit.Helpers.ISettingsStorageHelper<string>
type ApplicationDataStorageHelper = class
interface IFileStorageHelper
interface ISettingsStorageHelper<string>
Public Class ApplicationDataStorageHelper
Implements IFileStorageHelper, ISettingsStorageHelper(Of String)
- Inheritance
-
ApplicationDataStorageHelper
- Implements
Constructors
ApplicationDataStorageHelper(ApplicationData, IObjectSerializer) |
Initializes a new instance of the ApplicationDataStorageHelper class. |
Properties
AppData |
Gets the storage host. |
CacheFolder |
Gets the local cache folder. |
Folder |
Gets the storage folder. |
Serializer |
Gets the serializer for converting stored values. |
Settings |
Gets the settings container. |
Methods
Clear() | |
CreateCacheFileAsync<T>(String, T) |
Saves an object inside a file in the LocalCacheFolder. |
CreateCacheFolderAsync(String) |
Ensure a folder exists at the folder path specified in the LocalCacheFolder. |
CreateFileAsync<T>(String, T) |
Saves an object inside a file. |
CreateFolderAsync(String) |
Ensure a folder exists at the folder path specified. |
GetCurrent(IObjectSerializer) |
Get a new instance using ApplicationData.Current and the provided serializer. |
GetForUserAsync(User, IObjectSerializer) |
Get a new instance using the ApplicationData for the provided user and serializer. |
KeyExists(String, String) |
Determines whether a setting already exists in composite. |
KeyExists(String) |
Determines whether a setting already exists. |
Read<T>(String, String, T) |
Retrieves a single item by its key in composite. |
Read<T>(String, T) |
Retrieves a single item by its key. |
ReadCacheFileAsync<T>(String, T) |
Retrieves an object from a file in the LocalCacheFolder. |
ReadCacheFolderAsync(String) |
Retrieves the listings for a folder and the item types in the LocalCacheFolder. |
ReadFileAsync<T>(String, T) |
Retrieves an object from a file. |
ReadFolderAsync(String) |
Retrieves the listings for a folder and the item types. |
Save<T>(String, IDictionary<String,T>) |
Saves a group of items by its key in a composite. This method should be considered for objects that do not exceed 8k bytes during the lifetime of the application and for groups of settings which need to be treated in an atomic way. |
Save<T>(String, T) | |
TryDelete(String, String) |
Deletes a single item by its key in composite. |
TryDelete(String) | |
TryDeleteCacheItemAsync(String) |
Deletes a file or folder item in the LocalCacheFolder. |
TryDeleteItemAsync(String) |
Deletes a file or folder item. |
TryRead<T>(String, String, T) |
Attempts to retrieve a single item by its key in composite. |
TryRead<T>(String, T) | |
TryRenameCacheItemAsync(String, String) |
Rename an item in the LocalCacheFolder. |
TryRenameItemAsync(String, String) |
Rename an item. |
Extension Methods
Delete<TKey>(ISettingsStorageHelper<TKey>, TKey) |
Deletes a key from storage. |
GetValueOrDefault<TKey,TValue>(ISettingsStorageHelper<TKey>, TKey, TValue) |
Attempts to read the provided key and return the value. If the key is not found, the fallback value will be used instead. |
Read<TKey,TValue>(ISettingsStorageHelper<TKey>, TKey) |
Read the key in the storage helper instance and get the value. |