コード例 #1
0
ファイル: Main.cs プロジェクト: PabloCorso/BattleNotifier
        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;
 }