public bool IsInCollection(AlbumData referenceAlbum) { foreach (AlbumData album in Albums) { if (album == referenceAlbum) { return(true); } } return(false); }
public void RemoveAlbum(ref AlbumData album) { if (album.CanBeRemoved) { Albums.Remove(album); } else { throw new InvalidOperationException(album.Artist + " - " + album.Title); } }
public VinylAlbum(AlbumData a, int ncFront, int ncBack, MediaCondition e, MediaCondition ee, short y, string p) : base() { Album = a; Artist = a.Artist; Title = a.Title; SleeveCondition = ee; Year = y; Country = p; DiscList = new(); DiscList.Add(new VinylDisc(ncFront, ncBack, 'A', e)); Id = Convert.ToBase64String(Guid.NewGuid().ToByteArray()); //porque puede ser que tenga dos copias del mismo álbum Id = Id.Remove(Id.Length - 2); Id.Replace('+', 'm'); }
/* * public IPhysicalAlbum(AlbumData a, string s, MediaCondition estado, short y = 0, string p = null) * { * AlbumData = a; * EstadoExterior = estado; * Year = y; * Country = p; * Artist = AlbumData.Artist; * Title = AlbumData.Title; * }*/ public CompactDisc(AlbumData album, int nc, MediaCondition e, MediaCondition ee, SleeveType f, short y, string p) { Album = album; Artist = album.Artist; Title = album.Title; SleeveCondition = ee; Year = y; Country = p; SleeveType = f; Discos = new List <Disc>(1); Discos.Add(new Disc(nc, e)); Id = Convert.ToBase64String(Guid.NewGuid().ToByteArray()); //porque puede ser que tenga dos copias del mismo álbum Id = Id.Remove(Id.Length - 2); Id.Replace('+', 'm'); }
private void ReleaseLock(AlbumData a) { //First release the lock a.CanBeRemoved = true; foreach (var cd in CDS) { //If one copy refers that album, we cannot remove if (cd.Album == a) { a.CanBeRemoved = false; } } foreach (var vinyl in Vinyls) { if (vinyl.Album == a) { a.CanBeRemoved = false; } } }
public LongSong(string title, AlbumData album) { Title = title; AlbumFrom = album; Parts = new List <Song>(); }
public void AddAlbum(ref AlbumData album) { Albums.Add(album); }
public void InstallAlbum() { Album = Kernel.Collection.GetAlbum(Artist + "/**/" + Title); }