public void AddParameter(String displayName, String code,String defaultValue)
 {
     ProviderParameter parameter = new ProviderParameter(displayName, code, defaultValue);
     this.ProviderParameters.Add(parameter);
 }
Ejemplo n.º 2
0
 public ProviderParameter Clone()
 {
     ProviderParameter parameter = new ProviderParameter(this.DisplayName, this.Code, this.Value);
     return parameter;
 }
Ejemplo n.º 3
0
        public void Load()
        {
            this.Items.Clear();
            RegistryKey companyKey = Registry.LocalMachine.OpenOrCreateCompanyKey();
            RegistryKey geoPatKey = companyKey.OpenOrCreateKey("GeoPat");
            RegistryKey configKey = geoPatKey.OpenOrCreateKey("Configuration");
            RegistryKey providersKey = configKey.OpenOrCreateKey("Providers");
            String[] providersKeyNames = providersKey.GetSubKeyNames();
            foreach (String providerKeyName in providersKeyNames)
            {
                RegistryKey providerKey = providersKey.OpenOrCreateKey(providerKeyName);
                ProviderConfigurationItem item = new ProviderConfigurationItem();
                item.DisplayName = providerKey.GetValue("DisplayName").ToString();
                item.IsDefault = providerKey.GetValue("IsDefault").ToString().ToUpper ().Equals ("TRUE");
                item.ProviderFactoryTypeFullName = providerKey.GetValue("ProviderFactoryTypeFulleName").ToString();
                RegistryKey parametersKey = providerKey.OpenOrCreateKey("Parameters");
                String[] parametersKeyNames = parametersKey.GetSubKeyNames();
                foreach (String parametersKeyName in parametersKeyNames)
                {
                    RegistryKey parameterKey = parametersKey.OpenOrCreateKey(parametersKeyName);
                    ProviderParameter parameter = new ProviderParameter("",parameterKey.GetValue("Code").ToString(), parameterKey.GetValue("Value").ToString());
                    item.Parameters.Add(parameter);

                }
                this.Items.Add(item);
            }
        }