/// <summary> /// Saves the database. /// </summary> /// <param name="state"> The object state.</param> public static void SaveAccountDatabase(object state) { AccountDatabaseConfigurationHandler accountDatabaseHandler = new AccountDatabaseConfigurationHandler(); string file; if ( state == null ) { file = "AccountDatabase.xml"; } else { file = (string)state; } accountDatabaseHandler.Save(_accountDatabase, "Accounts", file); }
/// <summary> /// Loads te account database. /// </summary> public static void LoadAccountDatabase() { if ( _accountDatabase == null ) { AccountDatabaseConfigurationHandler databaseManager = new AccountDatabaseConfigurationHandler(); if ( System.Web.HttpContext.Current == null ) { _accountDatabase = (AccountDatabase)databaseManager.Load("Accounts", "AccountDatabase.xml"); } else { _accountDatabase = (AccountDatabase)databaseManager.Load("Accounts", System.Web.HttpContext.Current.Server.MapPath("users/AccountDatabase.xml")); } _accountDatabase.LoadAccountStore(); StartStoreAutoSaving(); } }