示例#1
0
 public void Save()
 {
     if (FullName == null)
     {
         throw new InvalidOperationException("Unable to save album with no name");
     }
     AlbumStorage.WriteAlbum(Album, FullName, Password);
 }
示例#2
0
 public void Save(string name, bool overwrite)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     if (name != FullName && AlbumExists(name) && !overwrite)
     {
         throw new ArgumentException("An album with this name exists");
     }
     AlbumStorage.WriteAlbum(Album, name, Password);
     FullName = name;
 }