private void DownloadButton_Click(object sender, RoutedEventArgs e) { if (DownloadScreen != null) { DownloadEnabled = false; _lastBytes = 0; DownloadScreen.Download(DownloadProgressHandler, DownloadCompletedHandler); } }
private void DownloadCompletedHandler(object sender, AsyncCompletedEventArgs args) { if (DownloadScreen.CheckIntegrity()) { DownloadEnabled = true; OnPropertyChanged("AvailableScreens"); MessageBox.Show(Strings.DownloadSucceeded, Strings.DownloadSuccess, MessageBoxButton.OK, MessageBoxImage.Information); } else { var result = MessageBox.Show(Strings.DownloadFailed, Strings.DownloadError, MessageBoxButton.YesNo, MessageBoxImage.Exclamation); if (result != MessageBoxResult.Yes) { DownloadEnabled = true; return; } DownloadProgress = 0.0d; _lastBytes = 0; DownloadScreen.Download(DownloadProgressHandler, DownloadCompletedHandler); } }