예제 #1
0
        private void btnAddTrim_Click(object sender, EventArgs e)
        {
            var node = treeFiles.SelectedNode;

            if (node == null)
            {
                return;
            }

            if (node is VideoFileTrimNode)
            {
                node = node.Parent;
            }

            var file = node as VideoFileNode;

            if (file == null)
            {
                return;
            }

            using (var dlg = new EditTrimDialog(GetTrimNames()))
            {
                dlg.Text = "Add Trim";
                if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                {
                    var trim = new VideoFileTrimNode();
                    ApplyTrim(trim, dlg);
                    file.Nodes.Add(trim);
                    file.Expand();
                }
            }
        }
예제 #2
0
 private void ApplyTrim(VideoFileTrimNode trim, EditTrimDialog dlg)
 {
     trim.Start      = dlg.Start;
     trim.End        = dlg.End;
     trim.SpecifyEnd = dlg.SpecifyEnd;
     trim.TrimName   = dlg.TrimName;
     trim.UpdateText();
 }
예제 #3
0
        private void btnEditTrim_Click(object sender, EventArgs e)
        {
            var trim = treeFiles.SelectedNode as VideoFileTrimNode;

            if (trim == null)
            {
                return;
            }

            using (var dlg = new EditTrimDialog(GetTrimNames(trim)))
            {
                dlg.Text       = "Edit Trim";
                dlg.Start      = trim.Start;
                dlg.End        = trim.End;
                dlg.SpecifyEnd = trim.SpecifyEnd;
                dlg.TrimName   = trim.TrimName;

                if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                {
                    ApplyTrim(trim, dlg);
                }
            }
        }