Table of Contents

Class AppDataAbstractBase<StorageFolder, StorageFile>

Namespace
SunamoPlatformUwpInterop.AppData
Assembly
SunamoPlatformUwpInterop.dll

Abstract base class for desktop application data management providing root folder management, file operations, and common settings access.

public abstract class AppDataAbstractBase<StorageFolder, StorageFile> : AppDataBase<StorageFolder, StorageFile>, IAppDataBase<StorageFolder, StorageFile>

Type Parameters

StorageFolder

The type representing a storage folder.

StorageFile

The type representing a storage file.

Inheritance
AppDataBase<StorageFolder, StorageFile>
AppDataAbstractBase<StorageFolder, StorageFile>
Implements
IAppDataBase<StorageFolder, StorageFile>
Derived
Inherited Members
Extension Methods

Methods

AppendAllText(AppFolders, string, string)

Appends text content to a file in the specified application folder.

public abstract Task AppendAllText(AppFolders appFolders, string fileName, string value)

Parameters

appFolders AppFolders

The application folder category.

fileName string

The file name.

value string

The text to append.

Returns

Task

AppendAllText(string, StorageFile)

Appends text content to the specified storage file.

public abstract Task AppendAllText(string value, StorageFile storageFile)

Parameters

value string

The text to append.

storageFile StorageFile

The storage file to append to.

Returns

Task

GetCommonSettings(string, bool)

Gets a common settings value for the specified key.

public abstract StorageFolder GetCommonSettings(string key, bool isCrypted = true)

Parameters

key string

The settings key.

isCrypted bool

Whether the value is encrypted.

Returns

StorageFolder

The common settings value.

GetFile(AppFolders, string)

Gets the file path for the specified file in the given application folder. Automatically creates the parent folder if it does not exist.

public abstract StorageFile GetFile(AppFolders appFolders, string fileName)

Parameters

appFolders AppFolders

The application folder category.

fileName string

The file name.

Returns

StorageFile

The storage file path.

GetFileString(string, string, bool)

Gets the file path as a string for the specified application folder name and file name.

public abstract StorageFile GetFileString(string appFolderName, string fileName, bool isUsingParentAppFolder = false)

Parameters

appFolderName string

The application folder name as a string.

fileName string

The file name.

isUsingParentAppFolder bool

Whether to use the parent application root folder.

Returns

StorageFile

The file path as a string.

GetRootFolder(string)

Gets the root folder for the application with the specified name.

public abstract StorageFolder GetRootFolder(string appName)

Parameters

appName string

The application name.

Returns

StorageFolder

The root folder for the application.

IsRootFolderNull()

Checks whether the root folder is null or empty.

public abstract bool IsRootFolderNull()

Returns

bool

True if the root folder is null or empty; otherwise false.

IsRootFolderOk()

Checks whether the root folder exists in the file system. If rootFolder is empty or null, returns false.

public abstract bool IsRootFolderOk()

Returns

bool

True if the root folder exists; otherwise false.

ReadFileOfSettingsDirectoryOrFile(string)

Reads a settings file value for a directory or file key. If the file does not exist, creates it with empty content.

public string ReadFileOfSettingsDirectoryOrFile(string key)

Parameters

key string

The settings key.

Returns

string

The settings value.

ReadFileOfSettingsOther(string)

Reads a string settings value for the specified key from loaded settings.

public string ReadFileOfSettingsOther(string key)

Parameters

key string

The settings key.

Returns

string

The settings value.

SaveFile(string, StorageFile)

Saves the specified content to the given storage file.

protected abstract Task SaveFile(string content, StorageFile storageFile)

Parameters

content string

The text content to save.

storageFile StorageFile

The storage file to save to.

Returns

Task

SetCommonSettings(string, string)

Sets a common settings value for the specified key.

public abstract void SetCommonSettings(string key, string value)

Parameters

key string

The settings key.

value string

The value to set.