예제 #1
0
        public void SortPlaylists(string selected)
        {
            switch (selected)
            {
            case "A-Z":
                Playlists = new ObservableCollection <LocalPlaylistModel>(Playlists.OrderBy(p => p.Playlist.Name).ToList());
                break;

            case "Z-A":
                Playlists = new ObservableCollection <LocalPlaylistModel>(Playlists.OrderByDescending(p => p.Playlist.Name).ToList());
                break;
            }
        }
예제 #2
0
        public virtual void AddPlaylist(Playlist playlist)
        {
            //  Client might not set the sequence number.
            if (playlist.Sequence < 0)
            {
                if (Playlists.Any())
                {
                    playlist.Sequence = Playlists.OrderBy(i => i.Sequence).Last().Sequence + 10000;
                }
                else
                {
                    playlist.Sequence = 10000;
                }
            }

            playlist.User = this;
            Playlists.Add(playlist);
        }
예제 #3
0
        public bool Equals(Season other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(ContentId.Equals(other.ContentId) &&
                   EndDate.Equals(other.EndDate) &&
                   string.Equals(IconUrl, other.IconUrl) &&
                   Id.Equals(other.Id) &&
                   IsActive == other.IsActive &&
                   string.Equals(Name, other.Name) &&
                   Playlists.OrderBy(p => p.Id).SequenceEqual(other.Playlists.OrderBy(p => p.Id)) &&
                   string.Equals(StartDate, other.StartDate));
        }