Exemple #1
0
 public void RemoveBand(XmlAlbumArtist o)
 {
     if (Library.ContainsKey(o.Name))
     {
         Library.Remove(o.Name);
     }
 }
Exemple #2
0
 public void AddBand(XmlAlbumArtist o)
 {
     if (!Library.ContainsKey(o.Name))
     {
         Library.Add(o.Name, o);
     }
 }
Exemple #3
0
        public void ValidateBand(XmlAlbumArtist band)
        {
            IEnumerator e = band.Albums.GetEnumerator();
            KeyValuePair <string, XmlAlbum> currAlbum = new KeyValuePair <string, XmlAlbum>();

            while (e.MoveNext())
            {
                currAlbum = (KeyValuePair <string, XmlAlbum>)e.Current;
                ValidateAlbum(currAlbum.Value);
            }
        }
Exemple #4
0
        /// <summary>
        /// Method to add a track to Player
        /// </summary>
        /// <param name="track"></param>
        private void AddTrack(XmlTrack track)
        {
            string albumName = track.AlbumArtist;

            if (string.IsNullOrEmpty(albumName))
            {
                albumName = Path.GetFileName(Path.GetDirectoryName(track.Location));
            }

            XmlAlbumArtist tempBand = GetBand(albumName);

            if (tempBand == null)
            {
                tempBand = new XmlAlbumArtist(albumName);
                Library.Add(tempBand.Name, tempBand);
                AlbumArtists.Add(tempBand);
            }

            XmlAlbum tempAlbum = tempBand.GetAlbum(track.GetAlbumKey());

            if (tempAlbum == null)
            {
                tempAlbum = new XmlAlbum(track.GetAlbumKey());
                Library[albumName].AddAlbum(tempAlbum);
                Albums.Add(tempAlbum);
            }

            XmlDisc tempDisc = tempAlbum.GetDisc(track.GetDiscKey());

            if (tempDisc == null)
            {
                tempDisc = new XmlDisc(track.GetDiscKey());
                Library[albumName].GetAlbum(track.GetAlbumKey()).AddDisc(tempDisc);
                Discs.Add(tempDisc);
            }

            if (Library[albumName].GetAlbum(track.GetAlbumKey()).GetDisc(track.GetDiscKey()).AddTrack(track))
            {
                Tracks.Add(track);
            }
        }
Exemple #5
0
 public void AddBand(XmlAlbumArtist o)
 {
     if (!Library.ContainsKey(o.Name))
         Library.Add(o.Name, o);
 }
Exemple #6
0
        /// <summary>
        /// Method to add a track to Player
        /// </summary>
        /// <param name="track"></param>
        private void AddTrack(XmlTrack track)
        {
            string albumName = track.AlbumArtist;
            if (string.IsNullOrEmpty(albumName))
                albumName = Path.GetFileName(Path.GetDirectoryName(track.Location));

            XmlAlbumArtist tempBand = GetBand(albumName);
            if (tempBand == null)
            {
                tempBand = new XmlAlbumArtist(albumName);
                Library.Add(tempBand.Name, tempBand);
                AlbumArtists.Add(tempBand);
            }

            XmlAlbum tempAlbum = tempBand.GetAlbum(track.GetAlbumKey());
            if (tempAlbum == null)
            {
                tempAlbum = new XmlAlbum(track.GetAlbumKey());
                Library[albumName].AddAlbum(tempAlbum);
                Albums.Add(tempAlbum);
            }

            XmlDisc tempDisc = tempAlbum.GetDisc(track.GetDiscKey());
            if (tempDisc == null)
            {
                tempDisc = new XmlDisc(track.GetDiscKey());
                Library[albumName].GetAlbum(track.GetAlbumKey()).AddDisc(tempDisc);
                Discs.Add(tempDisc);
            }

            if (Library[albumName].GetAlbum(track.GetAlbumKey()).GetDisc(track.GetDiscKey()).AddTrack(track))
            {
                Tracks.Add(track);
            }
        }
Exemple #7
0
        public void ValidateBand(XmlAlbumArtist band)
        {
            IEnumerator e = band.Albums.GetEnumerator();
            KeyValuePair<string, XmlAlbum> currAlbum = new KeyValuePair<string, XmlAlbum>();

            while (e.MoveNext())
            {
                currAlbum = (KeyValuePair<string, XmlAlbum>)e.Current;
                ValidateAlbum(currAlbum.Value);
            }
        }
Exemple #8
0
 public void RemoveBand(XmlAlbumArtist o)
 {
     if (Library.ContainsKey(o.Name))
         Library.Remove(o.Name);
 }