Пример #1
0
        public void UpdateSelectedSongTitle()
        {
            SongList.SelectedIndexChanged -= SongList_SelectedIndexChanged;
            SongList.BeginUpdate();

            List <int>       selected = SongList.SelectedIndices.Cast <int>().ToList();
            List <SongEntry> songs    = SelectedSongs.ToList();

            if (selected.Count != songs.Count)
            {
                return;
            }

            SongList.ClearSelected();

            for (int i = 0; i < songs.Count; ++i)
            {
                SongList.Items[selected[i]] = songs[i];
            }
            foreach (int i in selected)
            {
                SongList.SetSelected(i, true);
            }

            SongList.EndUpdate();
            SongList.SelectedIndexChanged += SongList_SelectedIndexChanged;
        }