public SettingsForm(KPSimpleBackupConfig config) { this.appConfig = config; InitializeComponent(); // load (already) configured values this.LoadValues(); }
public LongTermBackupManager(string basePath, string dbFileName, string dbFileExtension, PwDatabase database, KPSimpleBackupConfig config) { this.basePath = basePath; this.dbFileName = dbFileName; this.dbFileExtension = dbFileExtension; this.database = database; this.config = config; // assign folder paths this.basePathWeekly = basePath + dbFileName + LTB_FOLDER_SUFFIX + "/" + LTB_FOLDER_WEEKLY + "/"; this.basePathMonthly = basePath + dbFileName + LTB_FOLDER_SUFFIX + "/" + LTB_FOLDER_MONTHLY + "/"; this.basePathYearly = basePath + dbFileName + LTB_FOLDER_SUFFIX + "/" + LTB_FOLDER_YEARLY + "/"; }
public override bool Initialize(IPluginHost host) { if (host == null) { return(false); } m_host = host; m_config = new KPSimpleBackupConfig(m_host.CustomConfig); // add backup action event handler m_host.MainWindow.FileSaved += this.OnSaveAction; // initialization successful return(true); }
public override bool Initialize(IPluginHost host) { if (host == null) { return(false); } m_host = host; m_config = new KPSimpleBackupConfig(m_host.CustomConfig); m_logger = new Logger(m_config); // add backup action event handlers for when db is being saved and closed m_host.MainWindow.FileSaved += this.OnDatabaseSaveAction; m_host.MainWindow.FileClosingPre += this.OnDatabaseCloseAction; // initialization successful return(true); }
public override bool Initialize(IPluginHost host) { if (host == null) { return(false); } m_host = host; m_config = new KPSimpleBackupConfig(m_host.CustomConfig); m_PluginLogger = new Logger(m_config.LogToFile); BackupManager.SetConfig(m_config); BackupManager.SetPluginLogger(m_PluginLogger); CleanupManager.config = m_config; // add handler for KeePass events this plugin reacts to (file saving, closing, etc.) m_host.MainWindow.FileSaving += this.OnDatabaseSavingPreAction; m_host.MainWindow.FileSaved += this.OnDatabaseSaveAction; m_host.MainWindow.FileClosingPost += this.OnDatabaseCloseAction; // initialization successful return(true); }
public Logger(KPSimpleBackupConfig config) { this.config = config; this.currentLog = new List <string>(); }
/// <summary> /// Set KPSimpleBackupConfig to use. /// </summary> /// <param name="config">Configuration that should be used.</param> public static void SetConfig(KPSimpleBackupConfig config) { BackupManager.config = config; }