예제 #1
0
 public CustomConnectionItem(AdvancedConnectPluginExt plugin, ApplicationItem application, PwEntry keepassEntry)
 {
     this.plugin                  = plugin;
     this.keepassDatabase         = this.plugin.keepassHost.Database;
     this.application             = application;
     this.keepassEntry            = keepassEntry;
     this.customConnectionOptions = this.application.options;
 }
        public CustomConnectionItem(AdvancedConnectPluginExt plugin, ApplicationItem application, PwEntry keepassEntry)
        {
            this.plugin          = plugin;
            this.keepassDatabase = this.plugin.keepassHost.Database;
            this.application     = application;
            this.keepassEntry    = keepassEntry;

            String options = this.application.options;

            // Support optional some OPT like: [ string value |default value ], if string value is null, it will set OPT value to default value.
            if (Regex.IsMatch(options, @"\[\|"))
            {
                options = Regex.Replace(options, @"\[\|", "");
                options = Regex.Replace(options, @"\]", "");
            }
            else
            {
                options = Regex.Replace(options, @"\|.*\]", "");
                options = Regex.Replace(options, @"\[", "");
            }


            this.customConnectionOptions = options;
        }