Skip to end of metadata
Go to start of metadata

Represents the local storage service.

Definition

public class LocalStorageService : MobileComponentServiceBase, ILocalStorageService

Summary

The following table summarizes the members exposed in this class.

Public Constructors

LocalStorageService Constructor() Initializes a new instance of the LocalStorageService class.

Public Methods

DeleteFileAsync(string, LocalFolderKind) Deletes the file asynchronously.
GetFileInfoAsync(string, LocalFolderKind) Gets the file information asynchronously.
GetFilePath(string, LocalFolderKind) Gets the file path.
GetFilesAsync(string, LocalFolderKind) Gets the files from the specified folder asynchronously.
GetFolderPath(LocalFolderKind) Gets the folder path.
IsFileExisted(string, LocalFolderKind) Determines whether the file in specified LocalFolderKind.
IsSupported() Determines whether this instance is supported.
ReadFileAsync(string, LocalFolderKind) Reads the file asynchronously.
ReadTextFileAsync(string, LocalFolderKind) Reads the text file asynchronously.
RenameFileAsync(string, string, LocalFolderKind) Renames a file asynchronously.
WriteFileAsync(Byte[], string, LocalFolderKind, FileWriteMode) Writes the file asynchronously.
WriteTextFileAsync(string, string, LocalFolderKind, FileWriteMode) Writes the text file asynchronously.

Public Constructors

public LocalStorageService()

Public Methods

public Task<bool> DeleteFileAsync(string fileName, LocalFolderKind folderKind)

Deletes the file asynchronously.

Parameters

fileName Name of the file.
folderKind Kind of the folder.

Exceptions

FileNotFoundException The specified file ' + targetFile + ' cannot be found.

public Task<LocalFileInfo> GetFileInfoAsync(string fileName, LocalFolderKind folderKind)

Gets the file information asynchronously.

Parameters

fileName File name.
folderKind Folder kind.

Return Types

The file info async.

public string GetFilePath(string fileName, LocalFolderKind folderKind)

Gets the file path.

Parameters

fileName Name of the file.
folderKind The LocalFolderKind.

public Task<List<LocalFileInfo>> GetFilesAsync(string searchPattern, LocalFolderKind folderKind)

Gets the files from the specified folder asynchronously.

Parameters

searchPattern Search pattern.
folderKind Folder kind.

Return Types

The local file info.

public string GetFolderPath(LocalFolderKind folderKind)

Gets the folder path.

Parameters

folderKind The LocalFolderKind.

public bool IsFileExisted(string fileName, LocalFolderKind folderKind)

Determines whether the file in specified LocalFolderKind.

Parameters

fileName Name of the file.
folderKind The LocalFolderKind.

public bool IsSupported()

Determines whether this instance is supported.

Exceptions

NotImplementedException IsSupported is not implemented.

public Task<Byte[]> ReadFileAsync(string fileName, LocalFolderKind folderKind)

Reads the file asynchronously.

Parameters

fileName Name of the file.
folderKind Kind of the folder.

Exceptions

FileNotFoundException The specified file ' + targetFile + ' cannot be found.

public Task<string> ReadTextFileAsync(string fileName, LocalFolderKind folderKind)

Reads the text file asynchronously.

Parameters

fileName Name of the file.
folderKind Kind of the folder.

public Task<bool> RenameFileAsync(string sourceName, string targetName, LocalFolderKind folderKind)

Renames a file asynchronously.

Parameters

sourceName Source name.
targetName Target name.
folderKind Folder kind.

Return Types

The file async.

public Task<bool> WriteFileAsync(Byte[] data, string fileName, LocalFolderKind folderKind, FileWriteMode writeMode)

Writes the file asynchronously.

Parameters

data The data.
fileName Name of the file.
folderKind Kind of the folder.
writeMode The write mode.

public Task<bool> WriteTextFileAsync(string data, string fileName, LocalFolderKind folderKind, FileWriteMode writeMode)

Writes the text file asynchronously.

Parameters

data The data.
fileName Name of the file.
folderKind Kind of the folder.
writeMode The write mode.
  • No labels