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;
			}
		}
Exemple #2
0
 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);
     }
 }
Exemple #3
0
 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);
     }
 }
Exemple #4
0
        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);
                }
            }
        }