public void RemoveBand(XmlAlbumArtist o) { if (Library.ContainsKey(o.Name)) { Library.Remove(o.Name); } }
public void AddBand(XmlAlbumArtist o) { if (!Library.ContainsKey(o.Name)) { Library.Add(o.Name, o); } }
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); } }
/// <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); } }
public void AddBand(XmlAlbumArtist o) { if (!Library.ContainsKey(o.Name)) Library.Add(o.Name, o); }
/// <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); } }
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); } }
public void RemoveBand(XmlAlbumArtist o) { if (Library.ContainsKey(o.Name)) Library.Remove(o.Name); }