private void songListView_SelectedIndexChanged(object sender, EventArgs e) { if (this.songListView.SelectedItems.Count == 0) { this.mSelectedSong = null; } else { ListViewItem selectedSong = this.songListView.SelectedItems[0]; this.mSelectedSong = new MusicData.SongData( selectedSong.SubItems[2].Text, selectedSong.SubItems[0].Text, selectedSong.SubItems[1].Text); } }
private void musicTypeGenreSelectionChangeCommitted(object sender, EventArgs e) { TagValue <MusicData.MusicTypeIndex> musicType = this.musicTypeCMB.SelectedItem as TagValue <MusicData.MusicTypeIndex>; TagValue <string> genre = this.genreCMB.SelectedItem as TagValue <string>; if (musicType != null && genre != null) { this.mSelectedMusicType = musicType.Value; this.mSelectedGenre = genre.Value; this.mSelectedSong = null; this.songListView.Items.Clear(); List <MusicData.SongData> songList = MusicData.GetSongList(musicType.Value, genre.Value); MusicData.SongData song; for (int i = 0; i < songList.Count; i++) { song = songList[i]; this.songListView.Items.Add(new ListViewItem(new string[] { song.mSongName, song.mArtist, song.mSongKey })); } } }