public ManageableConfigurationSourceImplementation GetInstance(String configurationFilePath, IDictionary<String, ConfigurationSectionManageabilityProvider> manageabilityProviders, bool readGroupPolicies, bool generateWmiObjects, String applicationName) { if (String.IsNullOrEmpty(configurationFilePath)) throw new ArgumentException(Resources.ExceptionStringNullOrEmpty, "configurationFilePath"); String rootedConfigurationFilePath = RootConfigurationFilePath(configurationFilePath); if (!File.Exists(rootedConfigurationFilePath)) throw new FileNotFoundException(String.Format(Resources.Culture, Resources.ExceptionConfigurationLoadFileNotFound, rootedConfigurationFilePath)); ImplementationKey key = new ImplementationKey(rootedConfigurationFilePath, applicationName, readGroupPolicies); ManageableConfigurationSourceImplementation instance; lock (lockObject) { instances.TryGetValue(key, out instance); if (instance == null) { instance = new ManageableConfigurationSourceImplementation(rootedConfigurationFilePath, refresh, manageabilityProviders, readGroupPolicies, generateWmiObjects, applicationName); instances.Add(key, instance); } } return instance; }
public ManageableConfigurationSourceImplementation GetInstance(String configurationFilePath, IDictionary <String, ConfigurationSectionManageabilityProvider> manageabilityProviders, bool readGroupPolicies, bool generateWmiObjects, String applicationName) { if (String.IsNullOrEmpty(configurationFilePath)) { throw new ArgumentException(Resources.ExceptionStringNullOrEmpty, "configurationFilePath"); } String rootedConfigurationFilePath = RootConfigurationFilePath(configurationFilePath); if (!File.Exists(rootedConfigurationFilePath)) { throw new FileNotFoundException(String.Format(Resources.Culture, Resources.ExceptionConfigurationLoadFileNotFound, rootedConfigurationFilePath)); } ImplementationKey key = new ImplementationKey(rootedConfigurationFilePath, applicationName, readGroupPolicies); ManageableConfigurationSourceImplementation instance; lock (lockObject) { instances.TryGetValue(key, out instance); if (instance == null) { instance = new ManageableConfigurationSourceImplementation(rootedConfigurationFilePath, refresh, manageabilityProviders, readGroupPolicies, generateWmiObjects, applicationName); instances.Add(key, instance); } } return(instance); }
public ManageableConfigurationSourceImplementation GetInstance(string configurationFilePath, IDictionary<string, ConfigurationSectionManageabilityProvider> manageabilityProviders, bool readGroupPolicies, bool generateWmiObjects, string applicationName) { ManageableConfigurationSourceImplementation implementation; if (string.IsNullOrEmpty(configurationFilePath)) { throw new ArgumentException(Resources.ExceptionStringNullOrEmpty, "configurationFilePath"); } string path = RootConfigurationFilePath(configurationFilePath); if (!File.Exists(path)) { throw new FileNotFoundException(string.Format(Resources.Culture, Resources.ExceptionConfigurationLoadFileNotFound, new object[] { path })); } ImplementationKey key = new ImplementationKey(path, applicationName, readGroupPolicies); lock (this.lockObject) { this.instances.TryGetValue(key, out implementation); if (implementation == null) { implementation = new ManageableConfigurationSourceImplementation(path, this.refresh, manageabilityProviders, readGroupPolicies, generateWmiObjects, applicationName); this.instances.Add(key, implementation); } } return implementation; }
/// <summary> /// Initialize a new instance of the <see cref="ManageableConfigurationSource"/> class with the implementation. /// </summary> /// <param name="implementation"> /// A <see cref="ManageableConfigurationSourceImplementation"/> to use. /// </param> public ManageableConfigurationSource(ManageableConfigurationSourceImplementation implementation) { this.implementation = implementation; }
/// <summary> /// Initialize a new instance of the <see cref="ManageableConfigurationSource"/> class with the implementation. /// </summary> /// <param name="implementation"> /// A <see cref="ManageableConfigurationSourceImplementation"/> to use. /// </param> public ManageableConfigurationSource(ManageableConfigurationSourceImplementation implementation) { this.implementation = implementation; }