using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace GreenTree.Nachtragsmanagement.Services.Configuration { public static class ConfigurationHelper { /// /// Returns all available configuration references /// public static Dictionary GetAllConfigurationReferences() { var stateConfigurationReference = new StateConfigurationReference(); return new Dictionary() { { stateConfigurationReference.Name, stateConfigurationReference } }; } /// /// Returns all available configuration references for display /// public static Dictionary GetAllConfigurationReferencesDisplayList() { var stateConfigurationReference = new StateConfigurationReference(); return new Dictionary() { { stateConfigurationReference.Name, stateConfigurationReference.DisplayName } }; } /// /// Returns the configurationReference to the corresponding name /// /// Name of the configurationReference. public static IConfigurationReference GetConfigurationReferenceByName(string name) { var allConfigurationReferences = GetAllConfigurationReferences(); return allConfigurationReferences .Any(c => c.Key == name) ? allConfigurationReferences .First(c => c.Key == name).Value : null; } } }