コード例 #1
0
        public void AppendPropertiesFromConfiguration(string groupName)
        {
            ExceptionHelper.CheckStringIsNullOrEmpty(groupName, "groupName");

            PropertyGroupConfigurationElement group = PropertyGroupSettings.GetConfig().Groups[groupName];

            ExceptionHelper.FalseThrow <KeyNotFoundException>(group != null, "不能根据'{0}'找到对应的属性组定义", groupName);

            AppendPropertiesFromConfiguration(group);
        }
コード例 #2
0
        public static PropertyGroupSettings GetConfig()
        {
            PropertyGroupSettings settings = (PropertyGroupSettings)ConfigurationBroker.GetSection("propertyGroupSettings");

            if (settings == null)
            {
                settings = new PropertyGroupSettings();
            }

            return(settings);
        }