Example #1
0
        private void tsbCopyScore_Click(object sender, EventArgs e)
        {
            if (tvwScores.SelectedNode == null)
            {
                return;
            }

            BaseScore source = tvwScores.SelectedNode.Tag as BaseScore;
            BaseScore copy   = source.Clone(Tools.GenerateId());

            // add the new item and refresh
            m_center.AddScore(copy);

            // create node
            ThreeStateTreeNode node = new ThreeStateTreeNode(copy.Name);

            node.Tag = copy;
            if (tvwScores.SelectedNode.Parent != null)
            {
                tvwScores.SelectedNode.Parent.Nodes.Add(node);
            }
            else
            {
                tvwScores.Nodes.Add(node);
            }
        }