/// <summary> /// Refreshes the currently loaded configuration settings to the latest values from the configuration file. /// </summary> public static void Refresh() { lock (Locker) { ConfigurationManager.RefreshSection("blueCollarService"); section = null; } }
/// <summary> /// Gets a collection of application elements from the configuration. /// </summary> /// <returns>A collection of application elements.</returns> private static IEnumerable <ApplicationElement> GetApplicationElements() { IEnumerable <ApplicationElement> applications; try { BlueCollarServiceSection.Refresh(); applications = BlueCollarServiceSection.Section.Applications; } catch (ConfigurationErrorsException ex) { Logger.ErrorException("The configuration file is invalid. Please edit the configuration and re-save the file in order to load updated configuration information.", ex); applications = new ApplicationElement[0]; } return(applications); }