예제 #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 AlbumManager(string name) : this()
 {
     _name  = name;
     _album = AlbumStorage.ReadAlbum(name);
     if (Album.Count > 0)
     {
         Index = 0;
     }
 }
예제 #3
0
 public AlbumManager(string name, string pwd) : this()
 {
     _name    = name;
     _album   = AlbumStorage.ReadAlbum(name, pwd);
     Password = pwd;
     if (Album.Count > 0)
     {
         Index = 0;
     }
 }
예제 #4
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);
 }
예제 #5
0
        public AlbumManager(string name) : this()
        {
            _name = name;

            _album = AlbumStorage.ReadAlbum(name);
            if (Album.Count > 0)
            {
                Index = 0;
            }
            // TODO: load the album
            // throw new NotImplementedException();
        }
예제 #6
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 exists");
     }
     AlbumStorage.WriteAlbum(Album, name, Password);
     FullName = name;
 }
예제 #7
0
 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;
 }
예제 #8
0
 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;
 }
예제 #9
0
 public AlbumManager(string name, string pwd) : this()
 {
     _name    = name;
     _album   = AlbumStorage.ReadAlbum(name, pwd);
     Password = pwd;
 }