Andover.Data.Configuration.ConfigurationHelper.GetConfigurationSettings C# (CSharp) Method

GetConfigurationSettings() public static method

public static GetConfigurationSettings ( ) : List>.Dictionary
return List>.Dictionary
        public static Dictionary<ICategoryDto, List<IComponentDto>> GetConfigurationSettings()
        {
            var settings = new Dictionary<ICategoryDto, List<IComponentDto>>();

            var categories = Factory.GetConfigNode("andover/categories");
            var categoryList = categories.SelectNodes("category");
            foreach (XmlNode category in categoryList)
            {
                var categorySetting = new CategoryDto()
                    {
                        Description = category.Attributes["description"].InnerText,
                        Name = category.Attributes["name"].InnerText
                    };

                var componentSettings = new List<IComponentDto>();

                var components = category.SelectNodes("components/component");
                foreach (XmlNode component in components)
                {
                    var componentSetting = new ComponentDto()
                        {
                            Description = component.Attributes["description"].InnerText,
                            Name = component.Attributes["name"].InnerText,
                            Type = component.Attributes["type"].InnerText
                        };

                    componentSettings.Add(componentSetting);
                }

                settings.Add(categorySetting, componentSettings);
            }

            return settings;
        }