//
// Copy a configuration section to a string, and advance the reader.
//
internal string CopySection()
{
ResetCachedStringWriter();
// Preserve whitespace for sections for backcompat
WhitespaceHandling originalHandling = _reader.WhitespaceHandling;
_reader.WhitespaceHandling = WhitespaceHandling.All;
// Create string writer to write to
XmlUtilWriter utilWriter = new XmlUtilWriter(_cachedStringWriter, false);
// Copy the element
CopyElement(utilWriter);
// Reset whitespace handling
_reader.WhitespaceHandling = originalHandling;
if ((originalHandling == WhitespaceHandling.None) &&
(Reader.NodeType == XmlNodeType.Whitespace))
{
// If we were previously suppose to skip whitespace, and now we
// are at it, then lets jump to the next item
_reader.Read();
}
utilWriter.Flush();
string s = ((StringWriter)utilWriter.Writer).ToString();
return(s);
}