/* Closes application: * Clears session start time and optionally saves statistics */ private void NormalExit() { var config = ConfigurationManager.Instance; string summary = ""; bool shutdown = true; config.ClearSavedTime(); if (config.GatherStatistics) { if (config.GatherSummaries) { SummaryDialog summaryDialog = new SummaryDialog(); shutdown = (bool)summaryDialog.ShowDialog(); summary = summaryDialog.Summary; } if (shutdown) { StatisticsManager.SaveWorkTime(config.StartTime, summary); } } if (shutdown) { Application.Current.Shutdown(); } }
/// <summary> /// Opens the athlete registration dialog /// </summary> public void OpenSummaryDialog() { if (m_summaryDialog == null) { m_summaryDialog = new SummaryDialog(); } m_summaryDialog.Unloaded -= new System.Windows.RoutedEventHandler(CloseSummaryDialog); m_summaryDialog.Unloaded += new System.Windows.RoutedEventHandler(CloseSummaryDialog); summaryViewModel = new SummaryViewModel( this.model.GlobalSummary); m_summaryDialog.DataContext = summaryViewModel; m_summaryDialog.Show(); m_summaryDialog.Activate(); }
private void b_Summary_Click(object sender, RoutedEventArgs e) { // Query all the projects List<SummaryRow> items = new List<SummaryRow>(); //TimeSpan totalTime = new TimeSpan(0); foreach (var project in ProjectOrganizer.SortProjects(ProjectOrganizer.Projects, UserSettings.ProjectSortingMethod)) { //TimeSpan projTime = project.GetTotalProjectTime(); items.Add(new SummaryRow(project)); //totalTime += projTime; } //SummaryRow total = new SummaryRow("Total Time:", totalTime); // Display the window, but no need to wait for a response SummaryDialog window = new SummaryDialog("All Projects", items, true); window.Show(); }
/// <summary> /// Closes the athlete registration dialog /// </summary> public void CloseSummaryDialog(object sender, System.Windows.RoutedEventArgs e) { m_summaryDialog = null; }
private void b_Summary_Click(object sender, RoutedEventArgs e) { // Query the logs List<SummaryRow> items = new List<SummaryRow>(); foreach (var log in CurrentProject.CompletedLogs) { items.Add(new SummaryRow(log)); } // Show the summary window, but no need to wait for a response SummaryDialog window = new SummaryDialog("Project Summary", items, false); window.Show(); }
private void OnMenuSummaryClick(Object sender, EventArgs args) { SummaryDialog dialog = new SummaryDialog(); dialog.ShowDialog(this); }