示例#1
0
文件: Music.cs 项目: jpires/fooSpeech
 /// <summary>
 /// Creates a instance of Music
 /// </summary>
 /// <param name="title">Title of the music</param>
 /// <param name="duration">Duration in seconds of the music</param>
 /// <param name="album">A instance of the album that contains this music. Optional</param>
 /// <param name="artist">A instance of the Artist that creates this music. Optional</param>
 /// <param name="track">The Tack number of this music. Optional.</param>
 private Music(String title, UInt32 duration, Album album=null, Artist artist=null, UInt32 track = 0)
 {
     this.Title = title;
     this.Duration = duration;
     this.Album = album;
     this.Artist = artist;
     this.TrackNumber = track;
 }
示例#2
0
文件: Album.cs 项目: jpires/fooSpeech
 /// <summary>
 /// Creates a instance of Album
 /// </summary>
 /// <param name="name">Name of Album</param>
 /// <param name="artist">Instance of the Artist that Album</param>
 /// <param name="musicList">A list with the music that compose the Album. Optional</param>
 public Album(String name, Artist artist, List<Music> musicList = null)
 {
     this.Name = name;
     this.Artist = artist;
     if (musicList != null)
     {
         this.NumberOfTracks = (UInt32)musicList.Count;
         UInt32 duration = 0;
         foreach (Music music in musicList)
             duration += music.Duration;
         this.MusicList = musicList;
     }
     else
     {
         this.MusicList = new List<Music>();
     }
 }