public ConfigureTypeRegistrationBuilder(IConfigurationSourceBuilder configurationSourceBuilder, bool empty)
            {
                typeRegistrationsConfigurationSection = new TypeRegistrationProvidersConfigurationSection();
                if (empty)
                {
                    typeRegistrationsConfigurationSection.TypeRegistrationProviders.Clear();
                }

                configurationSourceBuilder.AddSection(TypeRegistrationProvidersConfigurationSection.SectionName, typeRegistrationsConfigurationSection);
            }
        private static void AddAutoscalingTypeRegistrationProviderElement(Common.Configuration.Design.IDesignConfigurationSource configurationSource, TypeRegistrationProvidersConfigurationSection typeRegistrationSection)
        {
            var element = new TypeRegistrationProviderElement
            {
                Name = RetryPolicyConfigurationSettings.SectionName,
                SectionName = RetryPolicyConfigurationSettings.SectionName
            };

            typeRegistrationSection.TypeRegistrationProviders.Add(element);
            configurationSource.AddLocalSection(TypeRegistrationProvidersConfigurationSection.SectionName, typeRegistrationSection);
        }
        /// <summary>
        /// Save the configuration source.
        /// </summary>
        /// <param name="configurationSource">The IDesignConfigurationSource.</param>
        public override void Save(Common.Configuration.Design.IDesignConfigurationSource configurationSource)
        {
            var typeRegistrationSection = configurationSource.GetLocalSection(TypeRegistrationProvidersConfigurationSection.SectionName) as TypeRegistrationProvidersConfigurationSection;

            if (typeRegistrationSection == null)
            {
                typeRegistrationSection = new TypeRegistrationProvidersConfigurationSection();
                typeRegistrationSection.TypeRegistrationProviders.Clear();
                AddAutoscalingTypeRegistrationProviderElement(configurationSource, typeRegistrationSection);
            }
            else
            {
                if (!typeRegistrationSection.TypeRegistrationProviders.Contains(RetryPolicyConfigurationSettings.SectionName))
                {
                    var cloner = new ConfigurationSectionCloner();
                    var savableSection = cloner.Clone(typeRegistrationSection) as TypeRegistrationProvidersConfigurationSection;
                    AddAutoscalingTypeRegistrationProviderElement(configurationSource, savableSection);
                }
            }

            base.Save(configurationSource);
        }