C# Class ModernApp4Me.Universal.Cache.M4MFilePersistence

Enables to store some contents into a specific StorageFolder. The classe implements the singleton pattern and is thread safe !
Afficher le fichier Open project: smartnsoft/ModernApp4Me

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
M4MFilePersistence ( ) : System

Method Details

CopyFile() public méthode

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)
Résultat Task

CopyFolder() public méthode

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
Résultat Task

CreateDirectory() public méthode

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
Résultat Task

CreateFolder() public méthode

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
Résultat Task

DeleteFile() public méthode

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
Résultat Task

DeleteFolder() public méthode

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
Résultat Task

GetFreeSpace() public méthode

Get the free space of a StorageFolder
public GetFreeSpace ( StorageFolder storageFolder ) : Task
storageFolder StorageFolder the folder where the function has to check
Résultat Task

GetUsedSpace() public méthode

Get the used space of a StorageFolder
public GetUsedSpace ( StorageFolder storageFolder ) : Task
storageFolder StorageFolder the folder where the function has to check
Résultat Task

IsFileExists() public méthode

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
Résultat Task

IsFolderExists() public méthode

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
Résultat Task

MoveFile() public méthode

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)
Résultat Task

MoveFolder() public méthode

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
Résultat Task

ReadFile() public méthode

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
Résultat Task

WriteFile() public méthode

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
Résultat Task