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); } }
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); } }
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 } }
private async void handleDeferredUpdateAsync() { var update = new OnlineUpdate(Settings, Resources.Default); await update.InstallAsync(_interactionHandler, () => Application.Exit()); }
private async void checkOnlineUpdate() { var update = new OnlineUpdate(Settings, Resources.Default); await update.UpdateAsync(_interactionHandler, () => Application.Exit(), isBusyForUpdate); }