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 })); } } }
public MusicSelectionDialog() { InitializeComponent(); this.musicTypeCMB.Items.Clear(); int i, count; List <TagValue <MusicData.MusicTypeIndex> > musicTypes = MusicData.GetAllLocalizedMusicTypes(); count = musicTypes.Count; for (i = 0; i < count; i++) { this.musicTypeCMB.Items.Add(musicTypes[i]); } this.genreCMB.Items.Clear(); List <TagValue <string> > genres = MusicData.GetAllLocalizedGenres(); count = genres.Count; for (i = 0; i < count; i++) { this.genreCMB.Items.Add(genres[i]); } }