/// <summary> /// Triggered when a KeePass database is being saved /// </summary> private static async void MainWindowOnFileSaved(object sender, FileSavedEventArgs fileSavedEventArgs) { var config = Configuration.GetPasswordDatabaseConfiguration(fileSavedEventArgs.Database.IOConnectionInfo.Path); config.KeePassDatabase = fileSavedEventArgs.Database; // Check if we should sync this database if (config.DoNotSync) { return; } // Make sure it's not a remote database on i.e. an FTP or website if (!fileSavedEventArgs.Database.IOConnectionInfo.IsLocalFile()) { MessageBox.Show("KeePass OneDriveSync does not support synchronizing databases from remote locations and will therefore not be available for this database", "KeePass OneDriveSync", MessageBoxButtons.OK, MessageBoxIcon.Information); config.DoNotSync = true; Configuration.Save(); return; } await KeePass.SyncDatabase(fileSavedEventArgs.Database.IOConnectionInfo.Path, KeePass.UpdateStatus); // If the OneDrive Refresh Token is stored in the KeePass database, we must trigger a save of the database here so to ensure that the actual value gets saved into the KDBX if (config.RefreshTokenStorage == OneDriveRefreshTokenStorage.KeePassDatabase) { fileSavedEventArgs.Database.Save(null); } }
/// <summary> /// Event handler to implement auto sync on save /// </summary> private void OnFileSaved(object sender, FileSavedEventArgs e) { if (e.Success == false) { return; } var conf = new SafeVaultConf(_host.Database); if (AutoSyncMode.Save != (conf.AutoSyncMode & AutoSyncMode.Save)) { return; } if (Keys.Shift == (Control.ModifierKeys & Keys.Shift)) { SetStatusText("Shift Key pressed. Auto Sync ignored."); return; } if (!IsSyncConfigured(conf)) { SetStatusText("SafeVault sync not configured."); return; } SyncWithSafeVault(SyncCommand.SyncRemote); }
/// <summary> /// The on file saved. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private void OnFileSaved(object sender, FileSavedEventArgs e) { if (this.m_appConfig.AutoBackup) { this._BackupDB(); } }
private void OnFileSaved(object sender, FileSavedEventArgs e) { MessageBox.Show("Notification received: the user has tried to save the current database to:\r\n" + m_host.Database.IOConnectionInfo.Path + "\r\n\r\nResult:\r\n" + (e.Success ? "Success" : "Failed"), "Formind Plugin", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void OnDatabaseSaveAction(object sender, FileSavedEventArgs e) { // only create backup if auto-backup is enabled if (this.m_config.AutoDatabaseBackup) { this.BackupAction(e.Database); } }
private async void OnFileSaved(object sender, FileSavedEventArgs e) { //Check to make sure the save isn't part of an already-ongoing synchronization to prevent infinite loops if (!_config.SyncOnSave || Synchronization.Synchronizing) { return; } await Synchronization.SynchronizeDbAsync(_host); }
private void OnFileSaved(object sender, FileSavedEventArgs e) { if (!IsPluginActive() || !IsActiveDatabase(e.Database)) { return; } //automatically trigger the export function of the syncMaster m_keeShare.Export(); }
/// <summary> /// Used to detect if the master key has been changed /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void OnSavedDB(Object sender, FileSavedEventArgs args) { var db = args.Database; var ioInfo = db.IOConnectionInfo; string dbPath = Library.CharChange(ioInfo.Path); if (!await UWPLibrary.FirstTime(dbPath) && await UWPLibrary.IsHelloAvailable() && !Library.CheckMasterKey(ioInfo, UWPLibrary.ck)) { await Library.HandleMasterKeyChange(ioInfo, dbPath, false); } }
private void Editor_FileSaved(object sender, FileSavedEventArgs e) { var file = File.Create(e.FilePath, true); file.SetData(e.Contents); if (e.FilePath.StartsWith("/bin/")) { file.Attributes = FileAttributes.Executable; } }
/// <summary> /// Event handler to implement auto sync on save /// </summary> private void OnFileSaved(object sender, FileSavedEventArgs e) { if (e.Success && AutoSyncMode.SAVE == (m_autoSync & AutoSyncMode.SAVE)) { if (Keys.Shift == (Control.ModifierKeys & Keys.Shift)) { ShowMessage("Shift Key pressed. Auto Sync ignored.", true); } else if (!LoadConfiguration()) { ShowMessage("No valid configuration found. Auto Sync ignored.", true); } else { syncWithGoogle(SyncCommand.SYNC, true); } } }
/// <summary> /// Event handler to implement auto sync on save /// </summary> private void OnFileSaved(object sender, FileSavedEventArgs e) { if (e.Success && AutoSyncMode.SAVE == (m_autoSync & AutoSyncMode.SAVE)) { if (Keys.Shift == (Control.ModifierKeys & Keys.Shift)) { ShowMessage("按下 Shift 键,跳过自动同步。", true); } else if (!LoadConfiguration()) { ShowMessage("找不到有效的配置,跳过自动同步。", true); } else { syncWithGoogle(SyncCommand.SYNC, true); } } }
/// <summary> /// Triggered when a KeePass database is being saved /// </summary> private async void MainWindowOnFileSaved(object sender, FileSavedEventArgs fileSavedEventArgs) { var databasePath = fileSavedEventArgs.Database.IOConnectionInfo.Path; // If the database is located under the folder from where KeePass runs, use a relative path instead of the absolute path if (fileSavedEventArgs.Database.IOConnectionInfo.Path.StartsWith(AppDomain.CurrentDomain.BaseDirectory)) { databasePath = databasePath.Remove(0, AppDomain.CurrentDomain.BaseDirectory.Length); } var config = Configuration.GetPasswordDatabaseConfiguration(databasePath); config.KeePassDatabase = fileSavedEventArgs.Database; // Check if we should sync this database if (config.DoNotSync) { return; } if (!_fileOfflineMenuItem.Checked) { Host.MainWindow.SetStatusEx(string.Format("OneDriveSync has been set to offline, skipping sync for database {0}", fileSavedEventArgs.Database.Name)); return; } // Make sure it's not a remote database on i.e. an FTP or website if (!fileSavedEventArgs.Database.IOConnectionInfo.IsLocalFile()) { MessageBox.Show("KeePass OneDriveSync does not support synchronizing databases from remote locations and will therefore not be available for this database", "KeePass OneDriveSync", MessageBoxButtons.OK, MessageBoxIcon.Information); config.DoNotSync = true; Configuration.Save(); return; } await KeePassDatabase.SyncDatabase(databasePath, KeePassDatabase.UpdateStatus, true, config); // If the OneDrive Refresh Token is stored in the KeePass database, we must trigger a save of the database here so to ensure that the actual value gets saved into the KDBX if (config.RefreshTokenStorage == OneDriveRefreshTokenStorage.KeePassDatabase) { fileSavedEventArgs.Database.Save(null); } }
private void OnFileSaved(object sender, FileSavedEventArgs e) { // nothing todo }
private void OnFileSaved(object sender, FileSavedEventArgs e) { Generator.UpdateAll(e.Database); }
private void OnKPDBSaved(object sender, FileSavedEventArgs e) { EnsureDBIconIsInKPRPCIconCache(); SignalAllManagedRPCClients(Signal.DATABASE_SAVED); }
private void OnFileSaved(object sender, FileSavedEventArgs e) { }
async void OnSaveDatabase(object sender, FileSavedEventArgs e) { await Task.Run(() => Syncronize(e.Database)); }
private void StartSync(Object sender, FileSavedEventArgs args) { Sync.StartSync(args.Database); }
private void OnKPDBSaved(object sender, FileSavedEventArgs e) { SignalAllManagedRPCClients(KeePassRPC.DataExchangeModel.Signal.DATABASE_SAVED); }
private void OnKPDBSaved(object sender, FileSavedEventArgs e) { EnsureDBIconIsInKPRPCIconCache(); SignalAllManagedRPCClients(KeePassRPC.DataExchangeModel.Signal.DATABASE_SAVED); }
private void OnFileSaved(object sender, FileSavedEventArgs fileSavedEventArgs) { this.IsSaving = false; }
private void StartExport(object sender, FileSavedEventArgs args) { Exporter.Export(args.Database); }