public void SaveBackupSets(IEnumerable<IBackupSet> backupSets)
 {
     var backupSetCollection = new BackupSetCollection();
     backupSetCollection.BackupSets.ReplaceRange(backupSets);
     backupSetCollection.SaveTime = DateTime.Now;
     backupSetCollection.Save(_path, SerializationMode.Xml);
 }
Ejemplo n.º 2
0
        public void SaveBackupSets(IEnumerable <IBackupSet> backupSets)
        {
            var backupSetCollection = new BackupSetCollection();

            backupSetCollection.BackupSets.ReplaceRange(backupSets);
            backupSetCollection.SaveTime = DateTime.Now;
            backupSetCollection.Save(_path, SerializationMode.Xml);
        }
Ejemplo n.º 3
0
        public IEnumerable <IBackupSet> LoadBackupSets()
        {
            if (!File.Exists(_path))
            {
                return(new BackupSet[] { });
            }

            var result = BackupSetCollection.Load(_path, SerializationMode.Xml);

            return(result.BackupSets.OrderBy(bs => bs.Name));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="BackupSetCollectionViewModel"/> class.
        /// </summary>
        public BackupSetCollectionWindowViewModel(BackupSetCollection backupSetCollection, IUIVisualizerService uiVisualizerService, IMessageService messageService)
        {
            Argument.IsNotNull(() => backupSetCollection);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => messageService);

            BackupSetCollection = backupSetCollection;
            _uiVisualizerService = uiVisualizerService;
            _messageService = messageService;

            AddBackupSet = new Command(OnAddBackupSetExecute);
            EditBackupSet = new Command(OnEditBackupSetExecute, OnEditBackupSetCanExecute);
            RemoveBackupSet = new Command(OnRemoveBackupSetExecute, OnRemoveBackupSetCanExecute);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="BackupSetCollectionViewModel"/> class.
        /// </summary>
        public BackupSetCollectionWindowViewModel(BackupSetCollection backupSetCollection, IUIVisualizerService uiVisualizerService, IMessageService messageService)
        {
            Argument.IsNotNull(() => backupSetCollection);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => messageService);

            BackupSetCollection  = backupSetCollection;
            _uiVisualizerService = uiVisualizerService;
            _messageService      = messageService;

            AddBackupSet    = new Command(OnAddBackupSetExecute);
            EditBackupSet   = new Command(OnEditBackupSetExecute, OnEditBackupSetCanExecute);
            RemoveBackupSet = new Command(OnRemoveBackupSetExecute, OnRemoveBackupSetCanExecute);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="BackupSetCollectionViewModel"/> class.
 /// </summary>
 public BackupSetCollectionViewModel(BackupSetCollection backupSetCollection)
 {
     Argument.IsNotNull(() => backupSetCollection);
     BackupSetCollection = backupSetCollection;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackupSetCollectionViewModel"/> class.
 /// </summary>
 public BackupSetCollectionViewModel(BackupSetCollection backupSetCollection)
 {
     Argument.IsNotNull(() => backupSetCollection);
     BackupSetCollection = backupSetCollection;
 }