Example #1
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            List <SongEntry> selected = (from SongEntry s in SongList.SelectedItems select s).ToList();

            List <string> path  = PathToSelectedGroup();
            TreeNode      group = GroupList.SelectedNode;

            if (group.ForeColor != Color.RoyalBlue)
            {
                group = group.Parent;
            }

            GroupList.BeginUpdate();
            SongList.BeginUpdate();

            foreach (var s in selected)
            {
                Metadata.AddSongToGroup(path, s.UniqueId);
                AddTreeViewSong(group, s);

                SongList.Items.Remove(s);
            }

            GroupList.EndUpdate();
            SongList.EndUpdate();

            MadeChanges = true;
        }