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; } } }
private async Task InitializeApp() { SplashProgressLabel.Text = ""; for (int i = 0; i <= 50; ++i) { Opacity = i * 0.02; await Task.Delay(10); } SplashProgressLabel.Text = "Initialize App"; BasicInitialize(); SplashProgressLabel.Text = "Checking App Version"; await Task.Delay(500); if (await ETC.CheckAppVersion()) { if (MessageBox.Show ( "프로그램 업데이트가 있습니다. 업데이트를 진행하시겠습니까?", "프로그램 업데이트 존재", MessageBoxButtons.YesNo, MessageBoxIcon.Question ) == DialogResult.Yes) { await ETC.UpdateProgram(SplashProgressLabel); } } SplashProgressLabel.Text = "Checking DB Version"; await Task.Delay(500); if (await ETC.CheckDBVersion()) { await ETC.UpdateDB(SplashProgressLabel); } await Task.Delay(500); SplashProgressLabel.Text = "Load DB"; await ETC.LoadDB(); await Task.Delay(500); SplashProgressLabel.Text = "Welcome to GFD-W"; await Task.Delay(500); Main main = new Main(); main.Show(); Visible = false; }