/// <summary>
        /// Creates the configuration node from XML.
        /// </summary>
        /// <param name="xmlContent">Content of the XML.</param>
        /// <returns>The created configuration section.</returns>
        public static ConfigurationSectionHandler CreateFromXml(string xmlContent)
        {
            var section = new ConfigurationSectionHandler();
            section.Init();

            // ReSharper disable once AssignNullToNotNullAttribute
            section.Reset(null);
            
            using (var reader = new XmlTextReader(new StringReader(xmlContent.Trim())))
            {
                section.DeserializeSection(reader);
            }
            section.ResetModified();
            return section;
        }
예제 #2
0
        /// <summary>
        /// Creates the configuration node from XML.
        /// </summary>
        /// <param name="xmlContent">Content of the XML.</param>
        /// <returns>The created configuration section.</returns>
        public static ConfigurationSectionHandler CreateFromXml(string xmlContent)
        {
            var section = new ConfigurationSectionHandler();

            section.Init();

            // ReSharper disable once AssignNullToNotNullAttribute
            section.Reset(null);

            using (var reader = new XmlTextReader(new StringReader(xmlContent.Trim())))
            {
                section.DeserializeSection(reader);
            }
            section.ResetModified();
            return(section);
        }