private static IConfigurationSet GetConfigurationSet(string filename) { ConfigurationSet configurationSet = null; Hashtable configColl = null; try { //The ConfigurationFactory instance is a singleton, it will be instantiated at this point only if it does not already exist. // call to create instance of the signleton CreateInstance(); } catch (Exception ex) { throw new Exception( String.Format("Error occured while calling to get the ConfigurationFactory instance in ConfigurationFactory.GetConfigurationSet :{0}" , ex.Message)); } try { //Creating ConfigurationSet with filename if not already created. configColl = m_Instance.m_configCollRepository; if (!configColl.Contains(filename)) { lock (configColl) { if (!configColl.Contains(filename)) { configurationSet = new ConfigurationSet(filename); configColl.Add(filename, configurationSet); } } } configurationSet = configColl[filename] as ConfigurationSet; } catch (Exception ex) { throw new Exception( String.Format("Error occured initializing Creating ConfigurationSet. in ConfigurationFactory.GetConfigurationSet :{0}" , ex.Message)); } return(configurationSet); }
private static IConfigurationSet GetConfigurationSet(string filename) { ConfigurationSet configurationSet = null; Hashtable configColl = null; try { //The ConfigurationFactory instance is a singleton, it will be instantiated at this point only if it does not already exist. // call to create instance of the signleton CreateInstance(); } catch (Exception ex) { throw new Exception( String.Format("Error occured while calling to get the ConfigurationFactory instance in ConfigurationFactory.GetConfigurationSet :{0}" , ex.Message)); } try { //Creating ConfigurationSet with filename if not already created. configColl = m_Instance.m_configCollRepository; if(!configColl.Contains(filename)) { lock (configColl) { if (!configColl.Contains(filename)) { configurationSet = new ConfigurationSet(filename); configColl.Add(filename, configurationSet); } } } configurationSet = configColl[filename] as ConfigurationSet; } catch(Exception ex) { throw new Exception( String.Format("Error occured initializing Creating ConfigurationSet. in ConfigurationFactory.GetConfigurationSet :{0}" , ex.Message)); } return configurationSet; }