private void MenuItemProperties_Click(object sender, RoutedEventArgs e) { var job = lbJobs.SelectedItem as UIJob; if (job == null) { return; } var dialog = new JobPropertyWindow(); dialog.Job = job; if (dialog.ShowDialog() == true) { //modify Job properties CoreFactory.ConfigurationService.UpdateJob(dialog.Job.Config); //refresh CollectionViewSource.GetDefaultView(_jobs).Refresh(); } }
private void btnNewJob_Click(object sender, RoutedEventArgs e) { var dialog = new JobPropertyWindow(); dialog.Job = new UIJob() { Config = new Job() { Id = Guid.NewGuid(), Type = JobType.Java, Executable = "", Arguments = "", WorkingDirectory = "", Enabled = true, Schedule = new Schedule() { Ever = false, CycleValue = 1, CycleUnit = CycleUnit.hours, Continuous = false, TimeHourFrom = 8, TimeMinuteFrom = 0, TimeHourTo = 16, TimeMinuteTo = 0 } }, Icon = UICanvasIcon.Init }; if (dialog.ShowDialog() == true) { //add job CoreFactory.ConfigurationService.AddJob(dialog.Job.Config); _jobs.Add(dialog.Job); } }