Пример #1
0
        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();
        }
Пример #2
0
 public static void InitializeConfigStorageBroker(Main mainView, MainPanel mainPanel, SettingsPanel settingsPanel)
 {
     if (instance == null)
         instance = new UserSettings(mainView, mainPanel, settingsPanel);
 }
Пример #3
0
 private UserSettings(Main mainView, MainPanel mainPanel, SettingsPanel settingsPanel)
 {
     this.mainView = mainView;
     this.mainPanel = mainPanel;
     this.settingsPanel = settingsPanel;
 }