예제 #1
0
 public void LoadSongs(string search)
 {
     if (!string.IsNullOrWhiteSpace(search))
     {
         // SongsInQueue = (_mediaDb.FetchSongs(search);
         SongsInQueue.AddRange(_mediaDb.FetchSongs(search));
     }
     else
     {
         throw new NullReferenceException("LoadSongs: search string is null empty");
     }
 }
예제 #2
0
        public void LoadSongs(string search)
        {
            if (string.IsNullOrWhiteSpace(search))
            {
                throw new NullReferenceException();
            }

            mediaDatabase.OpenConnection();

            List <ISong> fetchedSongs = mediaDatabase.FetchSongs(search);

            SongsInQueue.AddRange(fetchedSongs);
            mediaDatabase.CloseConnection();
        }
예제 #3
0
        public void LoadSongs(string search)
        {
            if (!String.IsNullOrEmpty(search))
            {
                var songs = _mediaDb.FetchSongs(search);

                if (songs != null && songs.Count() > 0)
                {
                    foreach (var song in songs)
                    {
                        songQueue.Add(song);
                    }
                }

                else
                {
                    throw new SearchFailedException();
                }
            }
            else
            {
                throw new SearchFailedException();
            }
        }