예제 #1
0
        void PerformLoading()
        {
            try
            {
                SetLoadingString("Loading Languages...");

                var language = LoadLanguages();

                SetLoadingString("Initializing base forms...");

                Program.Context.SplashForm.Invoke((Action)(() =>
                {
                    Editor.MainForm.FinishedLoadingLanguages();
                    Editor.MainForm.Initialize(language);
                }));

                if (GlobalSettings.AutoUpdate)
                {
                    SetLoadingString("Checking for updates...");

                    if (Program.Context.Updater.CheckForUpdates())
                    {
                        Program.Context.SplashForm.Invoke((Action)(() =>
                        {
                            Editor.ShowUpdateDialog(Program.Context.SplashForm);
                        }));
                    }
                }

                SetLoadingString("Loading swatches...");

                SwatchLoader.LoadSwatches();
                Program.Context.SplashForm.Invoke((Action)SwatchLoader.FinishedLoadingSwatches);

                SetLoadingString("Loading models...");

                ModelLoader.LoadModels();
                Program.Context.SplashForm.Invoke((Action)Editor.MainForm.FinishedLoadingModels);

                SetLoadingString("Loading skins...");

                SkinLoader.LoadSkins();

                Program.Context.SplashForm.Invoke((Action)Program.Context.DoneLoadingSplash);
                Program.Context.Form.Invoke((Action)(() =>
                {
                    Program.Context.SplashForm.Close();
                    GC.Collect();
                }
                                                     ));
            }
            catch (Exception ex)
            {
                Program.RaiseException(new Exception("Failed to initialize program during \"" + label1.Text + "\"", ex));
                Application.Exit();
            }
        }
예제 #2
0
파일: Splash.cs 프로젝트: yanfudi/mcskin3d
        void PerformLoading()
        {
            ErrorHandlerWrap(() =>
            {
                SetLoadingString("Loading Languages...");

                var language = LoadLanguages();

                SetLoadingString("Initializing base forms...");

                Program.Context.SplashForm.Invoke(ErrorHandlerWrap(() =>
                {
                    Editor.MainForm.FinishedLoadingLanguages();
                    Editor.MainForm.Initialize(language);
                }));

                if (GlobalSettings.AutoUpdate)
                {
                    SetLoadingString("Checking for updates...");

                    if (Program.Context.Updater.CheckForUpdates())
                    {
                        Program.Context.SplashForm.Invoke(ErrorHandlerWrap(() =>
                        {
                            Editor.ShowUpdateDialog(Program.Context.SplashForm);
                        }));
                    }
                }

                SetLoadingString("Loading swatches...");

                SwatchLoader.LoadSwatches();
                Program.Context.SplashForm.Invoke(ErrorHandlerWrap(SwatchLoader.FinishedLoadingSwatches));

                SetLoadingString("Loading models...");

                ModelLoader.LoadModels();
                Program.Context.SplashForm.Invoke(ErrorHandlerWrap(Editor.MainForm.FinishedLoadingModels));

                SetLoadingString("Loading skins...");

                SkinLoader.LoadSkins();

                Program.Context.SplashForm.Invoke(ErrorHandlerWrap(Program.Context.DoneLoadingSplash));

                Program.Context.Form.Invoke(ErrorHandlerWrap(() =>
                {
                    Program.Context.SplashForm.Close();
                    GC.Collect();
                }));
            })();
        }