public object Get(SaveBackup saveBackup) { BackupManager bum = new BackupManager(_config, _loggerFactory, _fileSystem); string message = bum.SaveBackup(); return(new List <string> { message }); }
private void DisplayBackup(SaveBackup backup) { var lvi = new ListViewItem { Text = backup.Comment }; lvi.SubItems.Add(backup.Saved.ToString()); lvi.SubItems.Add(backup.BackupLocation); lvi.SubItems.Add(backup.SourceLocation); lvi.Tag = backup; lvBackups.Items.Add(lvi); }
private void ExportBackup_Click(object sender, EventArgs e) { if (Data.IsEmpty) { "Nothing to save.".ShowAsError("Create passwords first!"); return; } if (SaveBackup.ShowDialog() == DialogResult.OK) { Data.Save(SaveBackup.FileName); MessageBox.Show("Backup has been successfully created!", "Backup saved!", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void BackupSave(string source, string destination) { try { File.Copy(source, destination); Log($"Backed up {source} to {destination}"); } catch (Exception ex) { Log(ex.Message); } var saveBackup = new SaveBackup(destination, source, "", DateTime.Now); _saveBackupIndex.Add(saveBackup); _saveBackupIndex.Save(BackupIndexName); }
public object Get(SaveBackup save_backup) { AuthorizationInfo user_info = _ac.GetAuthorizationInfo(Request); UserPolicy policy = _userManager.GetUserPolicy(user_info.User); if (!policy.IsAdministrator) { return(new List <string>() { "Not Authorized" }); } BackupManager bum = new BackupManager(_config, _logger, _fileSystem); string message = bum.SaveBackup(); return(new List <string>() { message }); }