public void Save() { if (Fullname == null) { throw new InvalidOperationException("Unable to save albm 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 && AlbumExits(name) && !overwrite) { throw new ArgumentException("An album with this name exits"); } AlbumStorage.WriteAlbum(Album, name); Fullname = name; }