Пример #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);
        }
Пример #2
0
 public override void Remove()
 {
     try
     {
         File.Delete(DiskPath);
     }
     catch (Exception err)
     {
         StdDialog.ShowError("s_path_cannot_be_deleted_delete_scheduled");
         DeletedFileRegistrer.AddPath(DiskPath, true);
         throw new DeleteError(DiskPath, err);
     }
 }
Пример #3
0
 public override void Remove()
 {
     if (IOTool.FileIsLink(DiskPath))
     {
         File.Delete(DiskPath);
     }
     else
     {
         try
         {
             Directory.Delete(DiskPath, true);
         }
         catch (Exception err)
         {
             StdDialog.ShowError("s_path_cannot_be_deleted_delete_scheduled");
             DeletedFileRegistrer.AddPath(DiskPath, true);
             throw new DeleteError(DiskPath, err);
         }
     }
 }