Beispiel #1
0
 public Song(string title, Album album, Artist artist, string mediaFilePath,Nullable<uint> albumTrack, string trackId, TimeSpan duration )
 {
     this.title = title;
     this.album = album;
     this.artist = artist;
     this.mediaFilePath = mediaFilePath;
     this.albumTrack = albumTrack;
     this.id = trackId;
     this.duration = duration;
 }
        public Album AddAlbum(string AlbumId, string AlbumName)
        {
            Album album = null;
            if( !allAlbums.ContainsKey(AlbumId))
            {
                album = new Album(AlbumId, AlbumName, this);
                allAlbums.Add(AlbumId, album);
            }
            else
            {
                album = allAlbums[AlbumId];
            }
            if( !albums.ContainsKey(AlbumId))
            {
                albums.Add(AlbumId, album);
                return album;
             }

            return null;
        }