//========================================================================================= // Config file / folder // static public string GetConfigFilePath() { //return "Config"; return(Path.Combine(TOLData.AppDataDirectory(), "Config")); }
static public string GetConfigFileName(string _name) { //return "Config\\TreeOfLifeConfig_" + _name + ".xml"; return(Path.Combine(TOLData.AppDataDirectory(), "Config", "TreeOfLifeConfig_" + _name + ".xml")); }
static void Main(string[] args) { System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("fr-FR"); Application.CurrentCulture = cultureInfo; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Init system Loggers.Register(new LogFile(null, true)); LogMessageBox logMessageBox = new LogMessageBox(); logMessageBox.SetVerboseMode(VerboseModeEnum.OnlyErrors); Loggers.Register(logMessageBox); SystemConfig.OnRunningModeChanged += Loggers_OnRunningModeChanged; Loggers.WriteInformation("Starting TreeOfLife : " + DateTime.Now.ToLongDateString()); #if USER SystemConfig.RunningMode = SystemConfig.RunningModeEnum.User; #else SystemConfig.RunningMode = SystemConfig.RunningModeEnum.Admin; #endif TaxonUtils.MyConfig = Config.Load("auto"); // TaxonUtils.MyConfig.ToData(); //Console.WriteLine(TaxonUtils.); if (!TaxonUtils.MyConfig.offline) { bool ok = TaxonUtils.CheckConnection(); if (!ok) { TaxonUtils.MyConfig.dataInitialized = false; Console.WriteLine(TaxonUtils.MyConfig.dataInitialized); } } InitForm initForm = new InitForm(); if (!TaxonUtils.MyConfig.dataInitialized) { initForm.ShowDialog(); TaxonUtils.MyConfig.rootDirectory = TOLData.AppDataDirectory(); Console.WriteLine(TaxonUtils.MyConfig.rootDirectory); } else { TOLData.offline = TaxonUtils.MyConfig.offline; } if (!initForm.quit) { TOLData.initSounds(); FormAbout.DoSplashScreen(); //----- config FormAbout.SetSplashScreenMessage(".. Loading config ..."); TaxonUtils.initCollections(); Application.Run(new Form1(args)); } }