Ejemplo n.º 1
0
        /// <summary>
        /// Loads the plugin settings from the KeePass configuration file.
        /// </summary>
        public override void Load()
        {
            this.Enabled                       = this.plugin.CustomConfig.GetBool(this.formatter.Format("Enabled"), true);
            this.CompatibleMode                = this.plugin.CustomConfig.GetBool(this.formatter.Format("CompatibleMode"), false);
            this.AddChangePasswordMenuItem     = this.plugin.CustomConfig.GetBool(this.formatter.Format("AddChangePasswordMenuItem"), false);
            this.PuttyPath                     = this.plugin.CustomConfig.GetString(this.formatter.Format("SSHClientPath"), String.Empty);
            this.WinScpPath                    = this.plugin.CustomConfig.GetString(this.formatter.Format("WinScpPath"), String.Empty);
            this.PsPasswdPath                  = this.plugin.CustomConfig.GetString(this.formatter.Format("PsPasswdPath"), String.Empty);
            this.HostAddressMapFieldName       = this.plugin.CustomConfig.GetString(this.formatter.Format("HostAddressMapFieldName"), String.Empty);
            this.ConnectionMethodMapFieldName  = this.plugin.CustomConfig.GetString(this.formatter.Format("ConnectionMethodMapFieldName"), String.Empty);
            this.AdditionalOptionsMapFieldName = this.plugin.CustomConfig.GetString(this.formatter.Format("AdditionalOptionsMapFieldName"), String.Empty);
            this.DisableCLIPasswordForPutty    = this.plugin.CustomConfig.GetBool(this.formatter.Format("DisableCLIPasswordForPutty"), false);

            // Shortcut Keys Settings.
            this.EnableShortcutKeys = GetConfigIfSet <bool?>(this.formatter.Format("EnableShortcutKeys"));

            var remoteDesktopShortcutKey = Keys.None;

            KeysHelper.TryParse(this.plugin.CustomConfig.GetString(this.formatter.Format("RemoteDesktopShortcutKey"), String.Empty), out remoteDesktopShortcutKey);
            this.RemoteDesktopShortcutKey = remoteDesktopShortcutKey;

            var puttyShortcutKey = Keys.None;

            KeysHelper.TryParse(this.plugin.CustomConfig.GetString(this.formatter.Format("PuttyShortcutKey"), String.Empty), out puttyShortcutKey);
            this.PuttyShortcutKey = puttyShortcutKey;

            var winScpShortcutKey = Keys.None;

            KeysHelper.TryParse(this.plugin.CustomConfig.GetString(this.formatter.Format("WinScpShortcutKey"), String.Empty), out winScpShortcutKey);
            this.WinScpShortcutKey = winScpShortcutKey;
        }