Beispiel #1
0
 public bool IsInCollection(AlbumData referenceAlbum)
 {
     foreach (AlbumData album in Albums)
     {
         if (album == referenceAlbum)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #2
0
 public void RemoveAlbum(ref AlbumData album)
 {
     if (album.CanBeRemoved)
     {
         Albums.Remove(album);
     }
     else
     {
         throw new InvalidOperationException(album.Artist + " - " + album.Title);
     }
 }
Beispiel #3
0
 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');
 }
Beispiel #4
0
        /*
         *         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');
        }
Beispiel #5
0
 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;
         }
     }
 }
Beispiel #6
0
 public LongSong(string title, AlbumData album)
 {
     Title     = title;
     AlbumFrom = album;
     Parts     = new List <Song>();
 }
Beispiel #7
0
 public void AddAlbum(ref AlbumData album)
 {
     Albums.Add(album);
 }
Beispiel #8
0
 public void InstallAlbum()
 {
     Album = Kernel.Collection.GetAlbum(Artist + "/**/" + Title);
 }