C# Класс ModernApp4Me.Universal.Cache.M4MFilePersistence

Enables to store some contents into a specific StorageFolder. The classe implements the singleton pattern and is thread safe !
Показать файл Открыть проект

Открытые методы

Метод Описание
CopyFile ( StorageFolder source, StorageFolder destination, string fileName, string destinationFileName = null ) : Task

Copy a file from a source StorageFolder to a destination StorageFolder

CopyFolder ( StorageFolder source, StorageFolder destination, string directoryName ) : Task

Copy a StorageFolder and its content to a specified directory

CreateDirectory ( StorageFolder storageFolder, string path ) : Task

Creates a directory into a specified StorageFolder by creating all missing StorageFolder

CreateFolder ( StorageFolder storageFolder, string folderName, CreationCollisionOption creationOption ) : Task

Creates a StorageFolder into a specified StorageFolder

DeleteFile ( StorageFolder storageFolder, string fileName ) : Task

Delete a file from a specified StorageFolder

DeleteFolder ( StorageFolder storageFolder, string folderName = null ) : Task

Removes a StorageFolder into a specified StorageFolder

GetFreeSpace ( StorageFolder storageFolder ) : Task

Get the free space of a StorageFolder

GetUsedSpace ( StorageFolder storageFolder ) : Task

Get the used space of a StorageFolder

IsFileExists ( StorageFolder storageFolder, string fileName ) : Task

Checks if a file exists into the StorageFolder

IsFolderExists ( StorageFolder storageFolder, string folderName ) : Task

Checks if a folder exists into the StorageFolder

MoveFile ( StorageFolder source, StorageFolder destination, string fileName, string destinationFileName = null ) : Task

Move a file from a source StorageFolder to a destination StorageFolder

MoveFolder ( StorageFolder source, StorageFolder destination, string directoryName ) : Task

Move a StorageFolder and its content to a specified directory

ReadFile ( StorageFolder storageFolder, string fileName ) : Task

Reads a file from a specified StorageFolder

WriteFile ( StorageFolder storageFolder, string fileName, string fileContent, CreationCollisionOption creationOption ) : Task

Writes a string into a file located into a specified StorageFolder

Приватные методы

Метод Описание
M4MFilePersistence ( ) : System

Описание методов

CopyFile() публичный Метод

Copy a file from a source StorageFolder to a destination StorageFolder
public CopyFile ( StorageFolder source, StorageFolder destination, string fileName, string destinationFileName = null ) : Task
source Windows.Storage.StorageFolder the source folder containing the file
destination Windows.Storage.StorageFolder the destination folder where write the new file
fileName string the file name
destinationFileName string the destination file name (if different from the source)
Результат Task

CopyFolder() публичный Метод

Copy a StorageFolder and its content to a specified directory
public CopyFolder ( StorageFolder source, StorageFolder destination, string directoryName ) : Task
source Windows.Storage.StorageFolder the source folder
destination Windows.Storage.StorageFolder the destination folder where create the copy
directoryName string the copy directory
Результат Task

CreateDirectory() публичный Метод

Creates a directory into a specified StorageFolder by creating all missing StorageFolder
public CreateDirectory ( StorageFolder storageFolder, string path ) : Task
storageFolder StorageFolder the folder where the function has to check
path string the directory path
Результат Task

CreateFolder() публичный Метод

Creates a StorageFolder into a specified StorageFolder
public CreateFolder ( StorageFolder storageFolder, string folderName, CreationCollisionOption creationOption ) : Task
storageFolder StorageFolder the folder where the function has to check
folderName string the folder name
creationOption CreationCollisionOption the
Результат Task

DeleteFile() публичный Метод

Delete a file from a specified StorageFolder
public DeleteFile ( StorageFolder storageFolder, string fileName ) : Task
storageFolder StorageFolder the folder where the function has to check
fileName string the name of the file to delete
Результат Task

DeleteFolder() публичный Метод

Removes a StorageFolder into a specified StorageFolder
public DeleteFolder ( StorageFolder storageFolder, string folderName = null ) : Task
storageFolder StorageFolder the folder where the function has to check
folderName string the folder name
Результат Task

GetFreeSpace() публичный Метод

Get the free space of a StorageFolder
public GetFreeSpace ( StorageFolder storageFolder ) : Task
storageFolder StorageFolder the folder where the function has to check
Результат Task

GetUsedSpace() публичный Метод

Get the used space of a StorageFolder
public GetUsedSpace ( StorageFolder storageFolder ) : Task
storageFolder StorageFolder the folder where the function has to check
Результат Task

IsFileExists() публичный Метод

Checks if a file exists into the StorageFolder
public IsFileExists ( StorageFolder storageFolder, string fileName ) : Task
storageFolder StorageFolder the folder where the function has to check
fileName string the name of the file
Результат Task

IsFolderExists() публичный Метод

Checks if a folder exists into the StorageFolder
public IsFolderExists ( StorageFolder storageFolder, string folderName ) : Task
storageFolder StorageFolder the folder where the function has to check
folderName string the name of the folder
Результат Task

MoveFile() публичный Метод

Move a file from a source StorageFolder to a destination StorageFolder
public MoveFile ( StorageFolder source, StorageFolder destination, string fileName, string destinationFileName = null ) : Task
source StorageFolder the source folder containing the file
destination StorageFolder the destination folder where write the new file
fileName string the file name
destinationFileName string the destination file name (if different from the source)
Результат Task

MoveFolder() публичный Метод

Move a StorageFolder and its content to a specified directory
public MoveFolder ( StorageFolder source, StorageFolder destination, string directoryName ) : Task
source StorageFolder the source folder
destination StorageFolder the destination folder where create the copy
directoryName string the copy directory
Результат Task

ReadFile() публичный Метод

Reads a file from a specified StorageFolder
public ReadFile ( StorageFolder storageFolder, string fileName ) : Task
storageFolder StorageFolder the folder where the function has to check
fileName string the name of the file to read
Результат Task

WriteFile() публичный Метод

Writes a string into a file located into a specified StorageFolder
public WriteFile ( StorageFolder storageFolder, string fileName, string fileContent, CreationCollisionOption creationOption ) : Task
storageFolder StorageFolder the folder where the function has to check
fileName string the file name
fileContent string the file content
creationOption CreationCollisionOption the
Результат Task