Esempio n. 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();
            }
        }
Esempio n. 2
0
        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();
                }));
            })();
        }
Esempio n. 3
0
 public List <Skin> LoadSkins()
 {
     return(_skinLoader.LoadSkins());
 }
 public SkinPoolViewModel(SkinLoader skinLoader)
 {
     Items.AddRange(skinLoader.LoadSkins().Select(x => new SkinDetailsViewModel {
         Name = x.Name, Duration = x.Duration, OffsetMonth = x.StartOffset.Month, OffsetDay = x.StartOffset.Day, OffsetHour = x.StartOffset.Hour
     }));
 }