static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SyncSharpLogic logic = new SyncSharpLogic(); logic.loadProfile(); logic.UpdateRemovableRoot(); bool runAutoForm = false; if (logic.Profile.TaskCollection != null) { foreach (SyncTask task in logic.Profile.TaskCollection) { runAutoForm = task.Settings.PlugSync; if (runAutoForm) break; } } if (runAutoForm) { AutoRunForm autoRunFrm = new AutoRunForm(logic); logic.AddUI(autoRunFrm); Application.Run(autoRunFrm); } MainForm mainFrm = new MainForm(logic); logic.RemoveAllUIs(); logic.AddUI(mainFrm); Application.Run(mainFrm); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { SyncSharpLogic logic = new SyncSharpLogic(); logic.LoadProfile(); if (!logic.SaveProfile()) return; logic.UpdateRemovableRoot(); bool runAutoForm = false; if (logic.Profile.TaskCollection != null) { foreach (SyncTask task in logic.Profile.TaskCollection) { runAutoForm = task.Settings.PlugSync; if (runAutoForm) break; } } if (runAutoForm) { AutoRunForm autoRunFrm = new AutoRunForm(logic); logic.AddUI(autoRunFrm); Application.Run(autoRunFrm); } MainForm mainFrm = new MainForm(logic); logic.RemoveAllUIs(); logic.AddUI(mainFrm); Application.Run(mainFrm); } catch (Exception e) { Logger.WriteSystemErrorLog(e.StackTrace); } }