private void kbtnInstall_Click(object sender, EventArgs e) { DialogResult = DialogResult.OK; _shouldLaunchInstallFileOnClose = true; _didCallDownloadProcessCompletedHandler = true; DownloadProcessCompleted?.Invoke(this, new DownloadInstallEventArgs(true)); }
private void DownloadProgressWindow_FormClosing(object sender, FormClosingEventArgs e) { FormClosing -= DownloadProgressWindow_FormClosing; if (!_didCallDownloadProcessCompletedHandler) { _didCallDownloadProcessCompletedHandler = true; DownloadProcessCompleted?.Invoke(this, new DownloadInstallEventArgs(_shouldLaunchInstallFileOnClose)); } }
/// <summary> /// Event called when the "Install and relaunch" button is clicked /// </summary> /// <param name="sender">not used.</param> /// <param name="e">not used.</param> private void OnInstallAndReLaunchClick(object sender, EventArgs e) { if (InvokeRequired) { Invoke((MethodInvoker) delegate() { OnInstallAndReLaunchClick(sender, e); }); } else { DialogResult = DialogResult.OK; _shouldLaunchInstallFileOnClose = true; _didCallDownloadProcessCompletedHandler = true; DownloadProcessCompleted?.Invoke(this, new DownloadInstallEventArgs(true)); } }
private void DownloadProgressWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (!_didCallDownloadProcessCompletedHandler) { _didCallDownloadProcessCompletedHandler = true; DownloadProcessCompleted?.Invoke(this, new DownloadInstallEventArgs(false)); } Closing -= DownloadProgressWindow_Closing; if (!_isOnMainThread && !_hasInitiatedShutdown) { _hasInitiatedShutdown = true; _cancellationTokenSource.Cancel(); } }
private void buttonCancel_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; _didCallDownloadProcessCompletedHandler = true; DownloadProcessCompleted?.Invoke(this, new DownloadInstallEventArgs(false)); }
/// <summary> /// Action that is invoked when the action button is clicked (e.g. for canceling or installing) /// </summary> /// <param name="sender">Object that invoked this action</param> /// <param name="e">Routed event that has information on the event</param> public void ActionButton_Click(object sender, RoutedEventArgs e) { _didCallDownloadProcessCompletedHandler = true; DownloadProcessCompleted?.Invoke(this, new DownloadInstallEventArgs(!(_dataContext?.IsDownloading ?? true))); }