Esempio n. 1
0
        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;
        }