Exemplo n.º 1
0
        bool OverrideWithGroupPoliciesAndGenerateWmiObjectsForOracleConnection(OracleConnectionData connectionData,
                                                                               bool readGroupPolicies,
                                                                               IRegistryKey machineKey,
                                                                               IRegistryKey userKey,
                                                                               bool generateWmiObjects,
                                                                               ICollection <ConfigurationSetting> wmiSettings)
        {
            if (readGroupPolicies)
            {
                IRegistryKey policyKey = machineKey ?? userKey;
                if (policyKey != null)
                {
                    if (policyKey.IsPolicyKey && !policyKey.GetBoolValue(PolicyValueName).Value)
                    {
                        return(false);
                    }
                    try
                    {
                        String packagesOverride = policyKey.GetStringValue(PackagesPropertyName);

                        connectionData.Packages.Clear();
                        Dictionary <String, String> packagesDictionary = new Dictionary <string, string>();
                        KeyValuePairParser.ExtractKeyValueEntries(packagesOverride, packagesDictionary);
                        foreach (KeyValuePair <String, String> kvp in packagesDictionary)
                        {
                            connectionData.Packages.Add(new OraclePackageData(kvp.Key, kvp.Value));
                        }
                    }
                    catch (RegistryAccessException ex)
                    {
                        LogExceptionWhileOverriding(ex);
                    }
                }
            }
            if (generateWmiObjects)
            {
                OracleConnectionSettingsWmiMapper.GenerateOracleConnectionSettingWmiObjects(connectionData, wmiSettings);
            }

            return(true);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initialize a new instance of the <see cref="OracleConnectionSettingsManageabilityProvider"/> class witha a set of sub providers.
 /// </summary>
 /// <param name="subProviders">A set of sub providers.</param>
 public OracleConnectionSettingsManageabilityProvider(IDictionary <Type, ConfigurationElementManageabilityProvider> subProviders)
     : base(subProviders)
 {
     OracleConnectionSettingsWmiMapper.RegisterWmiTypes();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates the <see cref="ConfigurationSetting"/> instances that describe the <paramref name="configurationSection"/>.
 /// </summary>
 /// <param name="configurationSection">The configuration section that must be managed.</param>
 /// <param name="wmiSettings">A collection to where the generated WMI objects are to be added.</param>
 protected override void GenerateWmiObjectsForConfigurationSection(OracleConnectionSettings configurationSection,
                                                                   ICollection <ConfigurationSetting> wmiSettings)
 {
     OracleConnectionSettingsWmiMapper.GenerateWmiObjects(configurationSection, wmiSettings);
 }
 protected override bool SaveChanges(ConfigurationElement sourceElement)
 {
     return(OracleConnectionSettingsWmiMapper.SaveChanges(this, sourceElement));
 }