상속: BaseViewModel
예제 #1
0
        public void PerformDelete(string original)
        {
            string message = String.Format("Delete: Do you really want to delete the backup for this file ({0})?", original);

            if (MessageBox.ShowQuestion(message) != System.Windows.MessageBoxResult.Yes)
            {
                return;
            }

            BackupItemViewModel backup = null;

            foreach (BackupItemViewModel item in _Items)
            {
                if (item.Original == original)
                {
                    backup = item;
                    break;
                }
            }

            if (backup != null)
            {
                if (File.Exists(backup.Path))
                {
                    File.Delete(backup.Path);
                }
            }

            RemoveItem(original);
        }
예제 #2
0
        private void PerformRestore(string original)
        {
            string message = String.Format("Restore: Are you sure you want to restore this file ({0})?", original);

            if (MessageBox.ShowQuestion(message) != System.Windows.MessageBoxResult.Yes)
            {
                return;
            }

            BackupItemViewModel backup = null;

            foreach (BackupItemViewModel item in _Items)
            {
                if (item.Original == original)
                {
                    backup = item;
                    break;
                }
            }

            if (backup != null)
            {
                RaiseRestoreRequested(original, backup.Contents);
            }
        }
예제 #3
0
 public void AddItem(Models.BackupItem model)
 {
     BackupItemViewModel item = new BackupItemViewModel(model, this);
     Items.Add(item);
 }
예제 #4
0
        public void AddItem(Models.BackupItem model)
        {
            BackupItemViewModel item = new BackupItemViewModel(model, this);

            Items.Add(item);
        }