public Jukebox(CDPlayer cdPlayer, User user, List <CD> cdCollection, SongSelector ts) { _cdPlayer = cdPlayer; _user = user; _cdCollection = cdCollection; _ts = ts; }
private void SelectAll(object sender, RoutedEventArgs e) { SongSelector.SelectAll(); SongSelector.Focus(); }
private void FolderClick(string header, SongSelector highLightPosition) { _currentListView = _library[header]; _currentHeader = header; var highlightThis = 0; if(SongsList.HasItems) SongsList.Items.Clear(); switch (highLightPosition) { case SongSelector.First: //TODO: Looking at the behavior here, this enum may be unneeded. A bool would effectively get the same thing done, but we'll hold on to this until we know there isnt anything else we want to do here :) { highlightThis = 0; break; } case SongSelector.Next: { highlightThis = _currentSong; break; } case SongSelector.Previous: { highlightThis = _currentSong; break; } default: //TODO: Should we have something here? I'm not sure. In theory it is impossible to have anything besides First/Next/Previous since I built the enum, but idk. { break; } } if (_currentPlaylist == _currentListView) highlightThis = _currentSong; if (header != "Streams") { foreach (var song in _library[header]) { var currentShell = ShellFile.FromFilePath(song.LocalPath); string songName; if (currentShell.Properties.System.Title.Value != null) { songName = currentShell.Properties.System.Title.Value; } else { songName = song.ToString(); songName = songName.Substring(songName.LastIndexOf("/", StringComparison.Ordinal) + 1); } var currentSong = highlightThis == 0 ? new ListViewItem() {Content = songName, Height = 20, Background = Brushes.Aqua} : new ListViewItem() {Content = songName, Height = 20}; highlightThis--; currentSong.MouseDoubleClick += (o, args) => CurrentSong_MouseDoubleClick(song, _library[header]); SongsList.Items.Add(currentSong); } } else { foreach (var stream in _library[header]) { var streamName = stream.ToString(); var currentSong = highlightThis == 0 ? new ListViewItem() {Content = streamName, Height = 20, Background = Brushes.Aqua} : new ListViewItem() {Content = streamName, Height = 20}; highlightThis--; currentSong.MouseDoubleClick += (o, args) => CurrentSong_MouseDoubleClick(stream, _library[header]); SongsList.Items.Add(currentSong); } } }