private void addSubTask_click(object sender, RoutedEventArgs e) { CustomTreeViewItem selected = treeView.SelectedItem as CustomTreeViewItem; if (selected != null) { if (selected.chkBox.IsEnabled == false && (selected.parent == null || (selected.parent != null && selected.parent.chkBox.IsEnabled == false))) { MessageBox.Show("Impossible d'ajouter une Sous-Tache!", "Media Task Manager", MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } newTask = new NewTask(); newTask.Show(); newTask.OnSaveEvent += new RoutedEventHandler(newTask_OnSaveNewSubTask); } }
private void OpenTask_Click(object sender, RoutedEventArgs e) { NewTask myTask = new NewTask(); if (myTask.ShowDialog() == true) { try { using (Process myProcess = new Process()) { myProcess.StartInfo.UseShellExecute = false; myProcess.StartInfo.FileName = myTask.getTaskCbx.SelectedItem.ToString(); myProcess.StartInfo.CreateNoWindow = true; myProcess.Start(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void addTask_click(object sender, RoutedEventArgs e) { newTask = new NewTask(); newTask.Show(); newTask.OnSaveEvent += new RoutedEventHandler(newTask_OnSaveNewTask); }