public static void ResetImplementation(string configurationFilepath, bool refreshing) { string rootedConfigurationFilepath = RootConfigurationFilePath(configurationFilepath); FileConfigurationSourceImplementation currentImplementation = null; implementationByFilepath.TryGetValue(rootedConfigurationFilepath, out currentImplementation); implementationByFilepath[rootedConfigurationFilepath] = new FileConfigurationSourceImplementation(rootedConfigurationFilepath, refreshing); if (currentImplementation != null) { currentImplementation.Dispose(); } }
private static void EnsureImplementation(string rootedConfigurationFile) { if (!implementationByFilepath.ContainsKey(rootedConfigurationFile)) { lock (lockObject) { if (!implementationByFilepath.ContainsKey(rootedConfigurationFile)) { FileConfigurationSourceImplementation implementation = new FileConfigurationSourceImplementation(rootedConfigurationFile); implementationByFilepath.Add(rootedConfigurationFile, implementation); } } } }