public void Save() { if (FullName == null) { throw new InvalidOperationException("Unable to save album with no name"); } AlbumStorage.WriteAlbum(Album, FullName); }
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); FullName = name; }