Ejemplo n.º 1
0
        private async Task InitializeMain()
        {
            try
            {
                StatusStrip_AppVerLabel.Text    = $"App Ver : {ETC.appVer}";
                StatusStrip_AppVerLabel.Text   += ETC.isReleaseMode ? "R" : "D";
                StatusStrip_DBVerLabel.Text     = $"DB Ver : {ETC.dbVer}";
                StatusStrip_OldGFDVerLabel.Text = $"GFDv1 Ver : {ETC.oldGFDVer}";

                UpdateCheckTimer.Start();
                UpdateCheckTimer_Tick(UpdateCheckTimer, new EventArgs());

                await LoadNotification();

                await CreateObject();

                await InitializeTDollDic();
                await InitializeEquipDic();
                await InitializeFairyDic();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
            }
        }
Ejemplo n.º 2
0
        private async void StatusStrip_DBVerLabel_Click(object sender, EventArgs e)
        {
            var label = sender as ToolStripStatusLabel;

            if (label.DisplayStyle == ToolStripItemDisplayStyle.ImageAndText)
            {
                if (MessageBox.Show("DB 업데이트가 확인되었습니다. 계속 진행할까요?", "DB 업데이트 확인", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    UpdateCheckTimer.Stop();
                    Enabled = false;
                    GFDStatusLabel.Visible = true;

                    await ETC.UpdateDB(GFDStatusLabel);

                    GFDStatusLabel.Text = "Reload GFD...";

                    await ETC.CheckDBVersion();
                    await InitializeMain();

                    Enabled = true;
                    UpdateCheckTimer.Start();
                    GFDStatusLabel.Visible = false;
                }
            }
        }
Ejemplo n.º 3
0
        private async void StatusStrip_AppVerLabel_Click(object sender, EventArgs e)
        {
            var label = sender as ToolStripStatusLabel;

            if (label.DisplayStyle == ToolStripItemDisplayStyle.ImageAndText)
            {
                if (MessageBox.Show("프로그램 업데이트가 확인되었습니다. 계속 진행할까요?", "프로그램 업데이트 확인", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    UpdateCheckTimer.Stop();
                    GFDStatusLabel.Visible = true;

                    if (!await ETC.UpdateProgram(GFDStatusLabel))
                    {
                        GFDStatusLabel.Visible = false;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public void LoadSettings()
        {
            SettingsController.LoadSettings();
            IniData data = SettingsController.GetCurrentSettings();

            if (data["Hotkeys"]["HotkeysEnable"] == "1")
            {
                SetHotkeysByStrings(data["Hotkeys"]["HotkeyUp"], data["Hotkeys"]["HotkeyDown"]);
            }

            if (data["Misc"]["Blur"] == "1" && Environment.OSVersion.Version.Major == 10)
            {
                Background = null;
                AcrylicWindow.SetEnabled(this, true);
            }

            UpdateCheckTimer.Tick += (sender, e) =>
            {
                CheckForUpdates(false);
            };

            if (data["Updates"]["DisableCheckEveryDay"] != "1")
            {
                UpdateCheckTimer.Start();
            }

            if (data["Updates"]["DisableCheckOnStartup"] != "1")
            {
                CheckForUpdates(false);
            }

            //AutoBrightness
            if (data["AutoBrightness"]["Enabled"] == "1")
            {
                CheckForSunriset.Start();
            }

            SetupAutoBrightnessTimer();

            TrayIcon.TrayBalloonTipClicked += (senderB, eB) => new Update().Window_Loaded();
        }
Ejemplo n.º 5
0
        public static void CheckForUpdates()
        {
            //AutoUpdater.ReportErrors = Program.DebugBuild;
            AutoUpdater.RunUpdateAsAdmin         = true;
            AutoUpdater.LetUserSelectRemindLater = true;
            AutoUpdater.RemindLaterTimeSpan      = RemindLaterFormat.Days;
            AutoUpdater.RemindLaterAt            = 1;
            AutoUpdater.DownloadPath             = Environment.CurrentDirectory;
            //AutoUpdater.ApplicationExitEvent += AutoUpdater_ApplicationExitEvent;
            if (UseJSONParser)
            {
                AutoUpdater.ParseUpdateInfoEvent += AutoUpdaterOnParseUpdateInfoEvent;
            }
            else
            {
                AutoUpdater.ParseUpdateInfoEvent -= AutoUpdaterOnParseUpdateInfoEvent;
            }

            Start();

            logger.Debug("Checking for updates...");
            UpdateCheckFinished = true;
            UpdateCheckTimer.Start();
        }
Ejemplo n.º 6
0
 public static void StartUpdateCheckTimer()
 {
     logger.Debug("Starting timer for update checking.");
     UpdateCheckTimer.Start();
 }