public Main() { InitializeComponent(); InitializeNotifyIcon(); CenterToScreen(); // Started from Windows startup, launch minimized. if (Program.LaunchedViaStartup) WindowState = FormWindowState.Minimized; // Initialize battle controller. BattleNotifierController.InitializeBattleNotifierController(this); battleNotifier = BattleNotifierController.Instance; // Initialize Main Panel. mainPanel = new MainPanel(); BackgroundPanel.Controls.Add(mainPanel); settingsPanel = new SettingsPanel(); NavigateHomeButton.Visible = false; UserSettings.InitializeConfigStorageBroker(this, mainPanel, settingsPanel); UserSettings.Load(); if (UserSettings.Instance.MustNotifyOnStartup()) mainPanel.NotificateBattles(); settingsPanel.UpdateRunOnWinStartupRegistryKey(); RegisterCurrentBattleHotkeyFromPanel(); }
public static void InitializeConfigStorageBroker(Main mainView, MainPanel mainPanel, SettingsPanel settingsPanel) { if (instance == null) instance = new UserSettings(mainView, mainPanel, settingsPanel); }
private UserSettings(Main mainView, MainPanel mainPanel, SettingsPanel settingsPanel) { this.mainView = mainView; this.mainPanel = mainPanel; this.settingsPanel = settingsPanel; }