C# Class ModernApp4Me.WP8.Cache.M4MFilePersistence

Enables to store some contents into the IsolatedStorageFile. The classe implements the singleton pattern and is thread safe !
Mostra file Open project: smartnsoft/ModernApp4Me

Public Methods

Method Description
CleanupIsolatedStorage ( ) : bool

Cleans-up the Isolated Storage

CreateDirectory ( string directoryName ) : bool

Creates a directory into the Isolated Storage.

CreateDirectoryFromFilePath ( string filePath ) : bool

Creates a directory from a complete path into the Isolated Storage

DeleteFile ( string fileName ) : bool

Deletes a file from the Isolated Storage.

IsFileExists ( string fileName ) : bool

Checks if a file exists into the Isolated Storage

ReadBinary ( string fileName ) : MemoryStream

Reads a binary contents from a file into the Isolated Storage

ReadFile ( string fileName ) : string

Reads a file from the Isolated StorageFile.

WriteFile ( string fileName, string fileContent, FileMode fileMode ) : bool

Writes a string into a file located into the Isolated Storage.

Private Methods

Method Description
M4MFilePersistence ( ) : System

Method Details

CleanupIsolatedStorage() public method

Cleans-up the Isolated Storage
public CleanupIsolatedStorage ( ) : bool
return bool

CreateDirectory() public method

Creates a directory into the Isolated Storage.
public CreateDirectory ( string directoryName ) : bool
directoryName string the name of the directory
return bool

CreateDirectoryFromFilePath() public method

Creates a directory from a complete path into the Isolated Storage
public CreateDirectoryFromFilePath ( string filePath ) : bool
filePath string the complete path
return bool

DeleteFile() public method

Deletes a file from the Isolated Storage.
public DeleteFile ( string fileName ) : bool
fileName string the name of the file to delete.
return bool

IsFileExists() public method

Checks if a file exists into the Isolated Storage
public IsFileExists ( string fileName ) : bool
fileName string the name of the file
return bool

ReadBinary() public method

Reads a binary contents from a file into the Isolated Storage
public ReadBinary ( string fileName ) : MemoryStream
fileName string the file to read
return System.IO.MemoryStream

ReadFile() public method

Reads a file from the Isolated StorageFile.
public ReadFile ( string fileName ) : string
fileName string the name of the file to read
return string

WriteFile() public method

Writes a string into a file located into the Isolated Storage.
public WriteFile ( string fileName, string fileContent, FileMode fileMode ) : bool
fileName string the file name
fileContent string the file content
fileMode FileMode the
return bool