public void Save() { if (FullName == null) { throw new InvalidOperationException("Unable to save album with no name"); } AlbumStorage.WriteAlbum(Album, FullName); }
public AlbumManager(string name) : this() { _name = name; _album = AlbumStorage.ReadAlbum(name); if (Album.Count > 0) { Index = 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); FullName = name; }
public AlbumManager(string name, string pwd) : this() { this.name = name; album = AlbumStorage.ReadAlbum(name, pwd); Password = pwd; }