public static void Create() { Busy = false; Ini = new UlIniFile(csIniFName); TotalLog = new UlLogger(); TotalLog.Path = Path.GetFullPath(Ini.GetString("Log", "TotalPath")); TotalLog.FName = Ini.GetString("Log", "TotalFileName"); DbLog = new UlLogger(); DbLog.Path = Path.GetFullPath(Ini.GetString("Log", "DatabasePath")); DbLog.FName = Ini.GetString("Log", "DatabaseFileName"); string connectString = Ini.GetString("Database", "ConnectString"); DB = new AppDatabase(connectString); if (string.IsNullOrWhiteSpace(connectString) == true) { DB.DataSource = Ini.GetString("Database", "DataSource"); DB.InitialCatalog = Ini.GetString("Database", "InitialCatalog"); DB.UserID = Ini.GetString("Database", "UserID"); DB.Password = Ini.GetString("Database", "Password"); } DB.Open(); Settings = new AppSettings(); TotalLog[ELogTag.Note] = $"Create application resource"; }
public static void Initialize() { Busy = false; State = EAppState.Opening; Properties = new AppProperies(); Properties.Load(); string dbPath = Ini.GetString("Database", "FileName"); if (Path.IsPathRooted(dbPath) == false) { dbPath = Path.GetFullPath(dbPath); } DB = new AppDatabase(); DB.Database = dbPath; DB.Open(); //Recipes = new RecipeList(); }