示例#1
0
        private void CopyGenres(Media media)
        {
            var c  = Genres.Count;
            var ec = media.Genres.Count;

            while (c > ec)
            {
                Genres.Remove(Genres.ElementAt(--c));
            }

            for (var i = 0; i < ec; i++)
            {
                MediaGenre genre;
                if (c < i + 1)
                {
                    genre = new MediaGenre();
                    Genres.Add(genre);
                }
                else
                {
                    genre = Genres.ElementAt(i);
                }

                genre.CopyFrom(media.Genres.ElementAt(i));
            }
        }
        public string DbgString()
        {
            StringBuilder s = new StringBuilder();

            s.AppendFormat("Title: {0}\n", Title);
            if ((AltTitles != null) && AltTitles.Any())
            {
                for (int x = 0; x < AltTitles.Count; x++)
                {
                    s.AppendFormat("AltTitle{0}:\n{1}\n", x + 1, AltTitles.ElementAt(x));
                }
            }
            if ((Accessories != null) && Accessories.Any())
            {
                for (int x = 0; x < Accessories.Count; x++)
                {
                    s.AppendFormat("Accessory{0}:\n{1}\n", x + 1, Accessories.ElementAt(x).AccessoryName);
                }
            }
            if ((DLCs != null) && DLCs.Any())
            {
                for (int x = 0; x < DLCs.Count; x++)
                {
                    s.AppendFormat("DLC{0}: {1}\n", x + 1, DLCs.ElementAt(x));
                }
            }
            if ((Genres != null) && Genres.Any())
            {
                for (int x = 0; x < Genres.Count; x++)
                {
                    s.AppendFormat("Genre{0}: {1}\n", x + 1, Genres.ElementAt(x));
                }
            }
            s.AppendFormat("Release Decade: {0}\n", ReleaseDecade);
            s.AppendFormat("Release Year: {0}\n", ReleaseYear);
            s.AppendFormat("Release Date: {0}\n", ReleaseDate);
            return(s.ToString());
        }