IgnoreSection
Provides a wrapper type definition for configuration sections that are not handled by the Configuration types.
using System.Xml;
namespace System.Configuration
{
public sealed class IgnoreSection : ConfigurationSection
{
private static volatile ConfigurationPropertyCollection s_properties;
private bool _isModified;
private string _rawXml = string.Empty;
protected internal override ConfigurationPropertyCollection Properties => EnsureStaticPropertyBag();
public IgnoreSection()
{
EnsureStaticPropertyBag();
}
private static ConfigurationPropertyCollection EnsureStaticPropertyBag()
{
if (s_properties == null) {
ConfigurationPropertyCollection configurationPropertyCollection = s_properties = new ConfigurationPropertyCollection();
}
return s_properties;
}
protected internal override bool IsModified()
{
return _isModified;
}
protected internal override void ResetModified()
{
_isModified = false;
}
protected internal override void Reset(ConfigurationElement parentSection)
{
_rawXml = string.Empty;
_isModified = false;
}
protected internal override void DeserializeSection(XmlReader xmlReader)
{
if (!xmlReader.Read() || xmlReader.NodeType != XmlNodeType.Element)
throw new ConfigurationErrorsException(System.SR.Config_base_expected_to_find_element, xmlReader);
_rawXml = xmlReader.ReadOuterXml();
_isModified = true;
}
protected internal override string SerializeSection(ConfigurationElement parentSection, string name, ConfigurationSaveMode saveMode)
{
return _rawXml;
}
}
}