Edit

Share via


LocalObjectStorageHelper Class

Definition

Caution

LocalObjectStorageHelper is deprecated and has been superceded by the ApplicationDataStorageHelper. To upgrade, simply swap any LocalObjectStorageHelper instances with ApplicationDataStorageHelper.GetCurrent(serializer). The underlying interfaces are nearly identical but now with even more features available, such as deletion and access to user specific data stores!

Store data in the Local environment (only on the current device).

public class LocalObjectStorageHelper : Microsoft.Toolkit.Uwp.Helpers.BaseObjectStorageHelper
[System.Obsolete("LocalObjectStorageHelper is deprecated and has been superceded by the ApplicationDataStorageHelper. To upgrade, simply swap any LocalObjectStorageHelper instances with ApplicationDataStorageHelper.GetCurrent(serializer). The underlying interfaces are nearly identical but now with even more features available, such as deletion and access to user specific data stores!")]
public class LocalObjectStorageHelper : Microsoft.Toolkit.Uwp.Helpers.BaseObjectStorageHelper
type LocalObjectStorageHelper = class
    inherit BaseObjectStorageHelper
[<System.Obsolete("LocalObjectStorageHelper is deprecated and has been superceded by the ApplicationDataStorageHelper. To upgrade, simply swap any LocalObjectStorageHelper instances with ApplicationDataStorageHelper.GetCurrent(serializer). The underlying interfaces are nearly identical but now with even more features available, such as deletion and access to user specific data stores!")>]
type LocalObjectStorageHelper = class
    inherit BaseObjectStorageHelper
Public Class LocalObjectStorageHelper
Inherits BaseObjectStorageHelper
Inheritance
LocalObjectStorageHelper
Attributes

Constructors

LocalObjectStorageHelper(IObjectSerializer)

Initializes a new instance of the LocalObjectStorageHelper class, which can read and write data using the provided IObjectSerializer; In 6.1 and older the default Serializer was based on Newtonsoft.Json. To implement an IObjectSerializer based on System.Text.Json, Newtonsoft.Json, or DataContractJsonSerializer see https://aka.ms/wct/storagehelper-migration.

Properties

Folder

Gets or sets the storage folder.

(Inherited from BaseObjectStorageHelper)
Settings

Gets or sets the settings container.

(Inherited from BaseObjectStorageHelper)

Methods

FileExistsAsync(String)

Determines whether a file already exists.

(Inherited from BaseObjectStorageHelper)
KeyExists(String, String)

Determines whether a setting already exists in composite.

(Inherited from BaseObjectStorageHelper)
KeyExists(String)

Determines whether a setting already exists.

(Inherited from BaseObjectStorageHelper)
Read<T>(String, String, T)

Retrieves a single item by its key in composite.

(Inherited from BaseObjectStorageHelper)
Read<T>(String, T)

Retrieves a single item by its key.

(Inherited from BaseObjectStorageHelper)
ReadFileAsync<T>(String, T)

Retrieves an object from a file.

(Inherited from BaseObjectStorageHelper)
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 (refers to SaveFileAsync<T>(String, T) for complex/large objects) and for groups of settings which need to be treated in an atomic way.

(Inherited from BaseObjectStorageHelper)
Save<T>(String, T)

Saves a single item by its key. This method should be considered for objects that do not exceed 8k bytes during the lifetime of the application (refers to SaveFileAsync<T>(String, T) for complex/large objects).

(Inherited from BaseObjectStorageHelper)
SaveFileAsync<T>(String, T)

Saves an object inside a file. There is no limitation to use this method (refers to Save<T>(String, T) method for simple objects).

(Inherited from BaseObjectStorageHelper)

Applies to