Ejemplo n.º 1
0
 /// <summary>
 /// Method for removing playlist and notyfing background
 /// music player about made changes
 /// </summary>
 /// <param name="playlist"></param>
 public void RemovePlaylist(MusicPlaylistViewModel playlist)
 {
     if (playlist != null)
     {
         MusicPlaylists.Remove(playlist);
         App.SendMessageToBackground(MessageType.RemovePlaylist, playlist.Name);
         MainPage.Instance.Refresh();
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Method which adds given playlist to playlists list;
 /// Used mainly for initialization
 /// </summary>
 /// <param name="playlist">Playlist to add</param>
 public void AddPlaylist(MusicPlaylistViewModel playlist)
 {
     if (!MusicPlaylists.Exists(m => m.Name == playlist.Name))
     {
         MusicPlaylists.Add(playlist);
         App.SendPlaylistDataToBackground(playlist);
     }
     MainPage.Instance.SetPlaylists(MusicPlaylists);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Method which creates new playlist with given name and
        /// notyfies background about new playlist
        /// </summary>
        /// <param name="playlistName">Playlist name</param>
        /// <returns>True if playlist was succesfully created</returns>
        public bool CreatePlaylist(string playlistName)
        {
            bool ifSuccess = false;

            if (!MusicPlaylists.Exists(m => m.Name.ToLower() == playlistName.ToLower()))
            {
                ifSuccess = true;
                MusicPlaylists.Add(new MusicPlaylistViewModel(playlistName));
                App.SendMessageToBackground(MessageType.NewPlaylist, playlistName);
                MainPage.Instance.Refresh();
            }
            return(ifSuccess);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Method which removes all playlists and notyfies background
 /// player about made changes
 /// </summary>
 public void RemoveAllPlaylists()
 {
     MusicPlaylists.Clear();
     App.SendMessageToBackground(MessageType.RemovePlaylist, 0.ToString());
     MainPage.Instance.Refresh();
 }