public static EditorResult Edit(VideoTask task) { using(TaskEditor te = new TaskEditor(task)) { if(te.ShowDialog() != DialogResult.OK) return EditorResult.Cancel; return te.cbSameForAll.Checked ? EditorResult.SameForAll : EditorResult.OK; } }
public static EditorResult Edit(VideoTask task) { using (TaskEditor te = new TaskEditor(task)) { if (te.ShowDialog() != DialogResult.OK) { return(EditorResult.Cancel); } return(te.cbSameForAll.Checked ? EditorResult.SameForAll : EditorResult.OK); } }
private void EditItem(object sender, EventArgs e) { if (LB.SelectedIndex < 0) { return; } try { VideoTask ti = Tasks.Where(t => t.FileFullPath.Equals(LB.SelectedItem.ToString(), StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault(); TaskEditor.Edit(ti); } catch (Exception ex) { Log(ex.Message); Log(ex.StackTrace); } }
private void AddItems(IList <string> items) { VideoTask tskForCopy = null; foreach (string file in items) { bool equals = false; foreach (string itm in LB.Items) { if (file.Equals(itm, StringComparison.CurrentCultureIgnoreCase)) { equals = true; break; } } if (equals) { continue; } if (tskForCopy == null) { VideoTask tsk = new VideoTask() { FileFullPath = file, LengthOnTn = true }; switch (TaskEditor.Edit(tsk)) { case EditorResult.OK: LB.Items.Add(file); Tasks.Add(tsk); break; case EditorResult.SameForAll: LB.Items.Add(file); Tasks.Add(tsk); tskForCopy = tsk.Clone(); break; } } else { VideoTask tsk = tskForCopy.Clone(); tsk.FileFullPath = file; LB.Items.Add(file); Tasks.Add(tsk); } } }