public void Save() { if (FullName == null) { throw new InvalidOperationException("Unable to save album with no name"); } AlbumStorage.WriteAlbum(Album, FullName, Password); }
public AlbumManager(string name) : this() { _name = name; _album = AlbumStorage.ReadAlbum(name); if (Album.Count > 0) { Index = 0; } }
public AlbumManager(string name, string pwd) : this() { _name = name; _album = AlbumStorage.ReadAlbum(name, pwd); Password = pwd; if (Album.Count > 0) { Index = 0; } }
/// <summary> /// 为一些最终的Save方法创建占位符 /// </summary> public void Save() { // ToDo:Implement Save method // throw new NotImplementedException(); if (FullName == null) { throw new InvalidOperationException("Unable to save album with no name"); } AlbumStorage.WriteAlbum(Album, FullName, PassWord); }
public AlbumManager(string name) : this() { _name = name; _album = AlbumStorage.ReadAlbum(name); if (Album.Count > 0) { Index = 0; } // TODO: load the album // throw new NotImplementedException(); }
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 exists"); } AlbumStorage.WriteAlbum(Album, name, Password); FullName = name; }
public void Save(string name, bool overwrite) { if (Fullname == null) { throw new InvalidOperationException("Unable to save album with no name"); } if (name != Fullname && AlbumExists(name) && !overwrite) { throw new ArgumentException("An album with this name exists"); } AlbumStorage.WriteAlbum(Album, name); Fullname = name; }
public void Save(string name, bool overwrite) { //ToDo: Implement Save(name) method //throw new NotImplementedException(); 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; }
public AlbumManager(string name, string pwd) : this() { _name = name; _album = AlbumStorage.ReadAlbum(name, pwd); Password = pwd; }