示例#1
0
文件: Program.cs 项目: Wetski/Demo06
        static void Main(string[] args)
        {
            //Create an album
            Album album = new Album { Name = "Black Holes and Revelations", Artist = "Muse" };

            //Create songs for the album
            Song song1 = new Song { Name = "Take a Bow", Duration = "4:35" };
            Song song2 = new Song { Name = "Starlight", Duration = "3:59" };
            Song song3 = new Song { Name = "Supermassive Black Hole", Duration = "3:29" };
            Song song4 = new Song { Name = "Map of the Problematique", Duration = "4:18" };
            Song song5 = new Song { Name = "Soldier's Poem", Duration = "2:03" };
            Song song6 = new Song { Name = "Invincible", Duration = "5:00" };
            Song song7 = new Song { Name = "Assassin", Duration = "3:31" };
            Song song8 = new Song { Name = "Exo-Politics", Duration = "3:53" };
            Song song9 = new Song { Name = "City of Delusion", Duration = "4:48" };
            Song song10 = new Song { Name = "Hoodoo", Duration = "3:43" };
            Song song11 = new Song { Name = "Knights of Cydonia", Duration = "6:06" };

            album.AddSong(song1);
            album.AddSong(song2);
            album.AddSong(song3);
            album.AddSong(song4);
            album.AddSong(song5);
            album.AddSong(song6);
            album.AddSong(song7);
            album.AddSong(song8);
            album.AddSong(song9);
            album.AddSong(song10);
            album.AddSong(song11);

            album.PrintData();
        }
示例#2
0
文件: Album.cs 项目: Wetski/Demo06
 public void AddSong(Song song)
 {
     songs.Add(song);
 }