C# Class BudgetAnalyser.Engine.Persistence.XamlOnDiskApplicationDatabaseRepository

Inheritance: IApplicationDatabaseRepository
Mostrar archivo Open project: Benrnz/BudgetAnalyser

Public Methods

Method Description
CreateNewAsync ( string storageKey ) : Task

Creates a new budget analyser database graph.

LoadAsync ( string storageKey ) : Task

Loads the Budget Analyser database graph from persistent storage.

SaveAsync ( ApplicationDatabase budgetAnalyserDatabase ) : System.Threading.Tasks.Task

Saves the Budget Analyser database graph to persistent storage.

XamlOnDiskApplicationDatabaseRepository ( ApplicationDatabase>.[ mapper ) : System

Initializes a new instance of the XamlOnDiskApplicationDatabaseRepository class.

Protected Methods

Method Description
FileExists ( string budgetAnalyserDataStorage ) : bool

Checks to see if the budget analyser identified by the budgetAnalyserDataStorage exists in storage or not.

LoadXamlAsString ( string fileName ) : string

Loads the xaml as a string.

Serialise ( BudgetAnalyserStorageRoot budgetAnalyserDatabase ) : string

Serialises the specified budget analyser database to a Xaml string.

WriteToDiskAsync ( string fileName, string data ) : System.Threading.Tasks.Task

Writes the data to local disk.

Private Methods

Method Description
LoadXmlFromDiskAsync ( string fileName ) : Task

Method Details

CreateNewAsync() public method

Creates a new budget analyser database graph.
public CreateNewAsync ( string storageKey ) : Task
storageKey string
return Task

FileExists() protected method

Checks to see if the budget analyser identified by the budgetAnalyserDataStorage exists in storage or not.
protected FileExists ( string budgetAnalyserDataStorage ) : bool
budgetAnalyserDataStorage string The budget analyser data storage.
return bool

LoadAsync() public method

Loads the Budget Analyser database graph from persistent storage.
File does not exist. /// Deserialisation Application Database file failed, an exception was thrown by the /// Xml deserialiser, the file format is invalid. ///
public LoadAsync ( string storageKey ) : Task
storageKey string
return Task

LoadXamlAsString() protected method

Loads the xaml as a string.
protected LoadXamlAsString ( string fileName ) : string
fileName string Name of the file.
return string

SaveAsync() public method

Saves the Budget Analyser database graph to persistent storage.
public SaveAsync ( ApplicationDatabase budgetAnalyserDatabase ) : System.Threading.Tasks.Task
budgetAnalyserDatabase ApplicationDatabase The budget analyser database.
return System.Threading.Tasks.Task

Serialise() protected method

Serialises the specified budget analyser database to a Xaml string.
protected Serialise ( BudgetAnalyserStorageRoot budgetAnalyserDatabase ) : string
budgetAnalyserDatabase BudgetAnalyserStorageRoot The budget analyser database.
return string

WriteToDiskAsync() protected method

Writes the data to local disk.
protected WriteToDiskAsync ( string fileName, string data ) : System.Threading.Tasks.Task
fileName string
data string
return System.Threading.Tasks.Task

XamlOnDiskApplicationDatabaseRepository() public method

Initializes a new instance of the XamlOnDiskApplicationDatabaseRepository class.
///
public XamlOnDiskApplicationDatabaseRepository ( ApplicationDatabase>.[ mapper ) : System
mapper ApplicationDatabase>.[
return System