public static SaveResult ( Result result ) : void | ||
result | Result | |
return | void |
private void AnalyzeButton_Click(object sender, RoutedEventArgs e) { NoPhotos = false; if (this.DeviceName.Text.Equals("") || this.DeviceName.Text.Equals("Enter Test Name Here")) { MessageBox.Show(Properties.Resources.IncorrectName, Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Warning); } else { RemoveAllPlaceHolders(); this.result.Name = this.DeviceName.Text; if (IsMethodologyFollowed()) { NavigationService navigationService = NavigationService.GetNavigationService(this); if (this.result.AllAnalyzed()) { //Either no change made to result, or a photo was deleted. Save the result and go directly to the Results Page ResultStore.SaveResult(this.result); navigationService.Navigate(new ResultPage(this.result, 1)); } else { //Some photos havent been analyzed, so go to ResultDetailPage navigationService.Navigate(new ResultDetailPage(this.result)); } } else { AddAllPlaceHolders(); MessageBox.Show(Properties.Resources.NoPhotosSelected, Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Warning); } } }
private async void Page_Loaded(object sender, RoutedEventArgs e) { if (!this.result.AllAnalyzed()) { this.photoAnalyzerCancellationTokenSource = new CancellationTokenSource(); bool success = await Analyze(this.categoryListViewItems, this.deviceName, this.photoAnalyzerCancellationTokenSource.Token); NavigationService navigationService = NavigationService.GetNavigationService(this); if (success) { navigationService.Navigate(new ResultPage(this.result, 2)); ResultStore.SaveResult(this.result); } else { navigationService.GoBack(); } } }