Esempio n. 1
0
        public SettingsForm(KPSimpleBackupConfig config)
        {
            this.appConfig = config;

            InitializeComponent();

            // load (already) configured values
            this.LoadValues();
        }
Esempio n. 2
0
        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 + "/";
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 6
0
 public Logger(KPSimpleBackupConfig config)
 {
     this.config     = config;
     this.currentLog = new List <string>();
 }
Esempio n. 7
0
 /// <summary>
 /// Set KPSimpleBackupConfig to use.
 /// </summary>
 /// <param name="config">Configuration that should be used.</param>
 public static void SetConfig(KPSimpleBackupConfig config)
 {
     BackupManager.config = config;
 }