public static void OpenOptions() { var alwaysOn = Settings.Default.AlwaysOn; var dialog = new Options(); dialog.ShowDialog(); if (alwaysOn != Settings.Default.AlwaysOn) { if (Settings.Default.AlwaysOn) { TrayIconHelper.CreateTrayIcon(); App.HideMainWindow(); } else { App.ShowMainWindow(); } } else { if (Settings.Default.AlwaysOn) { TrayIconHelper.RefreshTrayIconMenu(); } } }
public static bool Initialize() { if (IsExistingInstanceRunning()) { return(false); } SettingsHelper.UpgradeSettings(); LoadAccounts(); InitMainWindow(); if (Settings.Default.AlwaysOn) { TrayIconHelper.CreateTrayIcon(); if (!App.Arguments.Contains("-systemstartup")) { TrayIconHelper.ShowRunningInTrayBalloon(); } } LaunchStartAccount(); return(true); }