private void RemoveBranchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedBranch != null)
            {
                int index = BranchView.SelectedRows.First();
                if (index == Movie.CurrentBranch)
                {
                    Movie.CurrentBranch = -1;
                }
                else if (index < Movie.CurrentBranch)
                {
                    Movie.CurrentBranch--;
                }

                Movie.RemoveBranch(SelectedBranch);
                BranchView.RowCount = Movie.BranchCount;

                if (index == Movie.BranchCount)
                {
                    BranchView.ClearSelectedRows();
                    BranchView.SelectRow(Movie.BranchCount - 1, true);
                }

                //BranchView.Refresh();
                Tastudio.RefreshDialog();
                GlobalWin.OSD.AddMessage("Removed branch " + index.ToString());
            }
        }
Beispiel #2
0
        private void RemoveBranchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedBranch != null)
            {
                int index = BranchView.SelectedRows.First();
                if (index == Movie.CurrentBranch)
                {
                    Movie.CurrentBranch = -1;
                }
                else if (index < Movie.CurrentBranch)
                {
                    Movie.CurrentBranch--;
                }

                _backupBranch = SelectedBranch.Clone();
                UndoBranchToolStripMenuItem.Enabled = UndoBranchButton.Enabled = true;
                UndoBranchToolStripMenuItem.Text    = "Undo Branch Removal";
                toolTip1.SetToolTip(UndoBranchButton, "Undo Branch Removal");
                _branchUndo = BranchUndo.Remove;

                Movie.RemoveBranch(SelectedBranch);
                BranchView.RowCount = Movie.BranchCount;

                if (index == Movie.BranchCount)
                {
                    BranchView.ClearSelectedRows();
                    BranchView.SelectRow(Movie.BranchCount - 1, true);
                }

                CallRemovedCallback(index);
                Tastudio.RefreshDialog();
                GlobalWin.OSD.AddMessage("Removed branch " + index.ToString());
            }
        }
        private void RemoveBranchContextMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedBranch != null)
            {
                int index = BranchView.SelectedRows.First();
                if (index == CurrentBranch)
                {
                    CurrentBranch = -1;
                }

                Movie.RemoveBranch(SelectedBranch);
                BranchView.RowCount = Movie.BranchCount;

                if (index == BranchView.SelectedRows.FirstOrDefault())
                {
                    BranchView.ClearSelectedRows();
                }

                BranchView.Refresh();
            }
        }