private void PastTasksDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { SyncTask syncTask = PastTasksDataGrid.SelectedItem as SyncTask; if (syncTask == null) { return; } SyncTaskProgressForm form = new SyncTaskProgressForm(); form.SyncTask = syncTask; form.IsCompleted = true; form.ShowDialog(this.ParentWindow, "Progress", false, true); }
private void ProgressButton_Click(object sender, RoutedEventArgs e) { string taskId = ((Button)e.Source).Tag.ToString(); SyncTask syncTask = SyncTasksManager.GetInstance().SyncTasks.Where(t => t.ID.ToString().Equals(taskId, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault(); if (syncTask == null) { MessageBox.Show("Task not found"); return; } SyncTaskProgressForm form = new SyncTaskProgressForm(); form.SyncTask = syncTask; form.IsCompleted = true; form.ShowDialog(this.ParentWindow, "Progress", false, true); }
private void ScheduleNextButton_Click(object sender, RoutedEventArgs e) { SyncTask.ScheduleInterval = 0; SyncTask.ShouldSkipUpdates = SkipUpdateEventsCheckBox.IsChecked.Value; if (RunOnceRadioButtonYes.IsChecked == false) { int frequency = 0; if (int.TryParse(FrequencyTextBox.Text, out frequency) == false) { MessageBox.Show("This should be a numeric value"); //FrequencyTextBox.Select(); FrequencyTextBox.Focus(); return; } SyncTask.ScheduleInterval = frequency * 60 * 1000; } SyncTask.Scheduled = true; SyncTask.Status = "Awaiting to be queued"; Logger.Error("17", "SyncCopyListWizardForm"); if (IsInEditMode == false) { SyncTasksManager.GetInstance().AddSyncTask(SyncTask); } Logger.Error("18", "SyncCopyListWizardForm"); SyncTasksManager.GetInstance().SaveSyncTasks(); Logger.Error("19", "SyncCopyListWizardForm"); MessageBox.Show("Synchronization has started."); this.Close(true); Logger.Error("20", "SyncCopyListWizardForm"); SyncTaskProgressForm form = new SyncTaskProgressForm(); form.SyncTask = SyncTask; form.IsCompleted = false; form.ShowDialog(null, "Progress", false, true); }