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