示例#1
0
 public void bgw_DoWork(object sender, DoWorkEventArgs e)
 {
     using (OnlineUpdate worker = new OnlineUpdate(_resetEvents, _workerThread, e))
     {
         UpdateGUIProgressBar guiPrg  = this.UpdateProgressBar;
         UPdateGUIListView    guiList = this.UpdateListview;
         worker.GetUpdateInfo(_updateServers, guiPrg, guiList, oTableUpdate);
     }
 }
示例#2
0
 public void bgw_DoWork(object sender, DoWorkEventArgs e)
 {
     using (OnlineUpdate worker = new OnlineUpdate(_resetEvents, _workerThread, e))
     {
         UpdateGUIProgressBar guiPrg = this.UpdateProgressBar;
         UPdateGUIListView guiList = this.UpdateListview;
         worker.GetUpdateInfo(_updateServers, guiPrg, guiList, oTableUpdate);
     }
 }
示例#3
0
        public static void Main(params string[] args)
        {
            if (args.Length > 0 && args[1] == "/update" && !OnlineUpdate.HandleUpdateArgs(args))
            {
                return;
            }

            // ReSharper disable once ObjectCreationAsStatement
            using (_ = new Mutex(true, Application.ProductName, out bool createdNew))
            {
                if (createdNew)
                {
                    Run(args);
                    return;
                }
                RunWithArgs(args);
            }
        }
示例#4
0
        public static void Main(params string[] args)
        {
            if (args.Length > 0 && !OnlineUpdate.HandleUpdateArgs(args))
            {
                return;
            }

            bool createdNew;

            // ReSharper disable once ObjectCreationAsStatement
            new Mutex(true, Application.ProductName, out createdNew);
            if (!createdNew)
            {
                return;
            }

            // 绑定异常捕捉处理函数
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += (sender, e) =>
            {
                Util.ShowBugReportForm(e.Exception);
            };
            AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
            {
                if (e.IsTerminating)
                {
                }
                Util.ShowBugReportForm((Exception)e.ExceptionObject);
            };

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            try
            {
                Application.Run(new MainForm());
            }
            catch (ObjectDisposedException)
            {
                // ignore
            }
        }
示例#5
0
 private async void handleDeferredUpdateAsync()
 {
     var update = new OnlineUpdate(Settings, Resources.Default);
     await update.InstallAsync(_interactionHandler, () => Application.Exit());
 }
示例#6
0
 private async void checkOnlineUpdate()
 {
     var update = new OnlineUpdate(Settings, Resources.Default);
     await update.UpdateAsync(_interactionHandler, () => Application.Exit(), isBusyForUpdate);
 }