Ejemplo n.º 1
0
        static bool InitializeApp()
        {
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

            //SplashForm splash = null;
            if (!IsMono)
            {
                SplashForm.Start();
            }

            SplashForm.SetProgress("Loading core...", 0);
            //if (splash != null) splash.SetCurWork("Loading core...");
            Core.IsGUI = true;
            Core.Instance.CreateWantedDirs();
            HSplash.AddModuleInfo += SplashForm.AddModuleInfo;
            DeletedFileRegistrer.Initialize();
            Core.ConfigureLogging();
            AsyncTool.MainThread = Thread.CurrentThread;
            //NodeFactory.RegisterRootCreator(RootTreeNode.CreateRoot);
            FileTextProvider.LoadStdTexts();
            LicenseTool.ReloadLicenses();
            UICache.Load();

            PluginTools.AddMasterAssembly(Assembly.GetAssembly(typeof(Program)));
            PluginTools.LoadPlugins(SplashForm.LoadPluginCallback);

            SplashForm.SetProgress(Texts.Get("s_loading_configuration"), 80);
            //AddonLibrary.ReloadLibs();
            GlobalSettings.Initialize();
            InternetSettings.Initialize();
            Texts.Language = GlobalSettings.Pages.General().Language;
            HSettings.CallLoaded();

            if (CheckAutoUpdate.Run(SplashForm.EnsureNoSplash))
            {
                Environment.Exit(0);
                return(true);
            }

            Core.RunAutoInstall();

            Core.CopyDefaultData();

            UsageStats.OnStart();
            Favorites.OnStart();
            //SendUsageForm.UploadIfNeeded(SplashForm.EnsureNoSplash);

            SplashForm.SetProgress(Texts.Get("s_creating_main_window"), 100);

            Logging.Info("Starting DatAdmin GUI");
            return(false);
        }