private static void ShowUI() { var updateForm = new UpdateForm(); CultureInfo ci = Thread.CurrentThread.CurrentUICulture; updateForm.ShowDialog(); }
/// <summary> /// Shows standard update dialog. /// </summary> public static void ShowUpdateForm(UpdateInfoEventArgs args) { if (UpdateFormType == null) { using (var updateForm = new UpdateForm(args)) { if (UpdateFormSize.HasValue) { updateForm.Size = UpdateFormSize.Value; } if (updateForm.ShowDialog().Equals(DialogResult.OK)) { Exit(); } } } else { var form = (IForm)Activator.CreateInstance(UpdateFormType, args); var ret = form.ShowDialog(); if (ret.HasValue && ret.Value == true) { Exit(); } Running = false; } }
private static void ShowUpdateForm() { var updateForm = new UpdateForm(); if (updateForm.ShowDialog().Equals(DialogResult.OK)) { Exit(); } }
private static void ShowUI() { Task.Run(() => { var updateForm = new UpdateForm(); updateForm.ShowDialog(); updateForm.Dispose(); }); }
/// <summary> /// Shows standard update dialog. /// </summary> public static void ShowUpdateForm() { var updateForm = new UpdateForm(); if (UpdateFormSize.HasValue) { updateForm.Size = UpdateFormSize.Value; } if (updateForm.ShowDialog().Equals(DialogResult.OK)) { Exit(); } }
/// <summary> /// Shows standard update dialog. /// </summary> public static void ShowUpdateForm(UpdateInfoEventArgs args) { using (var updateForm = new UpdateForm(args)) { if (UpdateFormSize.HasValue) { updateForm.Size = UpdateFormSize.Value; } if (updateForm.ShowDialog().Equals(DialogResult.OK)) { Exit(); } } }
/// <summary> /// Opens the Download window that download the update and execute the installer when download completes. /// </summary> public static bool DownloadUpdate(UpdateInfoEventArgs args) { using (var downloadDialog = new UpdateForm(args)) { try { return(downloadDialog.ShowDialog().Equals(DialogResult.OK)); } catch (TargetInvocationException) { } } return(false); }
public static void ShowUpdateForm() { var updateForm = new UpdateForm(); var dialogResult = updateForm.ShowDialog(); if (UpdateFormClosedEvent != null) { UpdateFormClosedEvent(new UpdateFormClosedEventArgs(dialogResult)); } if (dialogResult.Equals(DialogResult.OK)) { Exit(); } }
/// <summary> /// Shows standard update dialog. /// <paramref name="updateOK">Download result.</paramref> /// </summary> public static void ShowUpdateForm(ref bool updateOK) { using (var updateForm = new UpdateForm()) { if (UpdateFormSize.HasValue) { updateForm.Size = UpdateFormSize.Value; } if (updateForm.ShowDialog().Equals(DialogResult.OK)) { updateOK = true; Exit(); return; } updateOK = false; } }
private static void ShowUpdateForm() { if (Mandatory) { if (DownloadUpdate()) { if (NeedRestart) { Exit(); } } } else { var updateForm = new UpdateForm(); if (updateForm.ShowDialog().Equals(DialogResult.OK)) { if (NeedRestart) { Exit(); } } } }
private static void ShowUI() { var updateForm = new UpdateForm(); updateForm.ShowDialog(); }
private static void BackgroundWorkerOnRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs runWorkerCompletedEventArgs) { if (!runWorkerCompletedEventArgs.Cancelled) { if (runWorkerCompletedEventArgs.Result is DateTime) { var remindLaterTime = (DateTime)runWorkerCompletedEventArgs.Result; SetTimer(remindLaterTime); } else { var args = runWorkerCompletedEventArgs.Result as UpdateInfoEventArgs; if (CheckForUpdateEvent != null) { CheckForUpdateEvent(args); } else { if (args != null) { if (args.IsUpdateAvailable) { if (!IsWinFormsApplication) { Application.EnableVisualStyles(); } Thread thread = new Thread(new ThreadStart(delegate { var updateForm = new UpdateForm(); if (updateForm.ShowDialog().Equals(DialogResult.OK)) { Exit(); } })); thread.CurrentCulture = thread.CurrentUICulture = CurrentCulture; thread.SetApartmentState(ApartmentState.STA); thread.Start(); return; } else { if (ReportErrors) { MessageBox.Show(Resources.UpdateUnavailableMessage, Resources.UpdateUnavailableCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); } } } else { if (ReportErrors) { MessageBox.Show( Resources.UpdateCheckFailedMessage, Resources.UpdateCheckFailedCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); } } } Running = false; } } }
private static void ShowUi() { var updateForm = new UpdateForm(_title, _appCastUrl, _appTitle, _currentVersion, _installedVersion, _changeLogUrl, _downloadUrl, _registryLocation, _remindLaterAt, _remindLaterFormat, _letUserSelectRemindLater); updateForm.ShowDialog(); }