Edit

Share via


BaseObjectStorageHelper Class

Definition

Caution

BaseObjectStorageHelper is deprecated and has been superceded by ApplicationDataStorageHelper.

Shared implementation of ObjectStorageHelper.

public abstract class BaseObjectStorageHelper : Microsoft.Toolkit.Uwp.Helpers.IObjectStorageHelper
[System.Obsolete("BaseObjectStorageHelper is deprecated and has been superceded by ApplicationDataStorageHelper.")]
public abstract class BaseObjectStorageHelper : Microsoft.Toolkit.Uwp.Helpers.IObjectStorageHelper
type BaseObjectStorageHelper = class
    interface IObjectStorageHelper
[<System.Obsolete("BaseObjectStorageHelper is deprecated and has been superceded by ApplicationDataStorageHelper.")>]
type BaseObjectStorageHelper = class
    interface IObjectStorageHelper
Public MustInherit Class BaseObjectStorageHelper
Implements IObjectStorageHelper
Inheritance
BaseObjectStorageHelper
Derived
Attributes
Implements

Constructors

BaseObjectStorageHelper(IObjectSerializer)

Initializes a new instance of the BaseObjectStorageHelper 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.

Settings

Gets or sets the settings container.

Methods

FileExistsAsync(String)

Determines whether a file already exists.

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.

ReadFileAsync<T>(String, T)

Retrieves an object from a file.

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.

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).

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).

Applies to