コード例 #1
0
 public void Save()
 {
     if (Fullname == null)
     {
         throw new InvalidOperationException("Unable to save albm with no name");
     }
     AlbumStorage.WriteAlbum(Album, Fullname);
 }
コード例 #2
0
 public AlbumManager(string name) : this()
 {
     _name  = name;
     _album = AlbumStorage.ReadAlbum(name);
     if (Album.Count > 0)
     {
         Index = 0;
     }
 }
コード例 #3
0
 public void Save(string name, bool overwrite)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     if (name != Fullname && AlbumExits(name) && !overwrite)
     {
         throw new ArgumentException("An album with this name exits");
     }
     AlbumStorage.WriteAlbum(Album, name);
     Fullname = name;
 }