2 writes to Reader
System.Configuration.ConfigurationManager (2)
System\Configuration\XmlUtil.cs (2)
67
Reader
= new XmlTextReader(_stream) { XmlResolver = null };
138
Reader
= null;
217 references to Reader
System.Configuration.ConfigurationManager (217)
System\Configuration\AppSettingsSection.cs (5)
111
if (xmlUtil.
Reader
.Name != elementName)
116
lineOffset = xmlUtil.
Reader
.LineNumber;
120
while (!xmlUtil.
Reader
.EOF)
122
XmlNodeType t = xmlUtil.
Reader
.NodeType;
126
xmlUtil.
Reader
.Read();
System\Configuration\BaseConfigurationRecord.cs (69)
571
ConfigStreamInfo.StreamEncoding = xmlUtil.
Reader
.Encoding;
582
if (xmlUtil.
Reader
.Depth == 1) ScanSections(xmlUtil);
1389
while (xmlUtil.
Reader
.Depth > 0)
1391
if (xmlUtil.
Reader
.Name == LocationTag)
1395
xmlUtil.
Reader
.GetAttribute(LocationPathAttribute);
1435
int depth = xmlUtil.
Reader
.Depth;
1438
while (xmlUtil.
Reader
.Depth > depth)
1440
if (xmlUtil.
Reader
.Name == name)
1453
int lineOffset = xmlUtil.
Reader
.LineNumber;
1459
if ((iKey == 0) && (xmlUtil.
Reader
.Name == LocationTag))
1461
string locationSubPath = xmlUtil.
Reader
.GetAttribute(LocationPathAttribute);
1505
if (xmlUtil.
Reader
.Name != name)
1509
string protectionProviderAttribute = xmlUtil.
Reader
.GetAttribute(ProtectionProviderAttribute);
1512
if (xmlUtil.
Reader
.AttributeCount != 1)
1522
int lineOffset = xmlUtil.
Reader
.LineNumber;
1526
while (!xmlUtil.
Reader
.EOF)
1528
XmlNodeType t = xmlUtil.
Reader
.NodeType;
1532
xmlUtil.
Reader
.Read();
1757
if ((xmlUtil.
Reader
.NodeType != XmlNodeType.Element) || (xmlUtil.
Reader
.Name != ConfigurationTag))
1762
while (xmlUtil.
Reader
.MoveToNextAttribute())
1763
switch (xmlUtil.
Reader
.Name)
1766
if (xmlUtil.
Reader
.Value == ConfigurationNamespace)
1776
SR.Format(SR.Config_namespace_invalid, xmlUtil.
Reader
.Value, ConfigurationNamespace),
1788
if ((xmlUtil.
Reader
.Depth != 1) || (xmlUtil.
Reader
.Name != ConfigSectionsTag))
1817
int depth = xmlUtil.
Reader
.Depth;
1820
while (xmlUtil.
Reader
.Depth == depth + 1)
1824
switch (xmlUtil.
Reader
.Name)
1831
int lineNumber = xmlUtil.
Reader
.LineNumber;
1832
while (xmlUtil.
Reader
.MoveToNextAttribute())
1833
switch (xmlUtil.
Reader
.Name)
1836
tagName = xmlUtil.
Reader
.Value;
1848
xmlUtil.
Reader
.MoveToElement();
1917
int lineNumber = xmlUtil.
Reader
.LineNumber;
1918
while (xmlUtil.
Reader
.MoveToNextAttribute())
1919
switch (xmlUtil.
Reader
.Name)
1922
tagName = xmlUtil.
Reader
.Value;
1935
allowExeDefinition = AllowExeDefinitionToEnum(xmlUtil.
Reader
.Value, xmlUtil);
1962
OverrideModeSetting.ParseOverrideModeXmlValue(xmlUtil.
Reader
.Value, xmlUtil));
1979
xmlUtil.
Reader
.MoveToElement();
2067
while (xmlUtil.
Reader
.MoveToNextAttribute())
2069
if (xmlUtil.
Reader
.Name != SectionNameAttribute)
2072
name = xmlUtil.
Reader
.Value;
2074
xmlUtil.
Reader
.MoveToElement();
2094
if (xmlUtil.
Reader
.Depth > depth + 1)
2100
while (xmlUtil.
Reader
.Depth > depth + 1) xmlUtil.ReadToNextElement();
2124
xmlUtil.
Reader
.Value switch
2340
depth = xmlUtil.
Reader
.Depth;
2344
while (xmlUtil.
Reader
.Depth == depth + 1)
2346
string tagName = xmlUtil.
Reader
.Name;
2434
if (xmlUtil.
Reader
.AttributeCount > 0)
2438
while (xmlUtil.
Reader
.MoveToNextAttribute())
2439
if (IsReservedAttributeName(xmlUtil.
Reader
.Name))
2442
xmlUtil.
Reader
.MoveToElement(); // if on an attribute move back to the element
2515
if (xmlUtil.
Reader
.AttributeCount >= 1)
2519
string configSourceAttribute = xmlUtil.
Reader
.GetAttribute(ConfigSourceAttribute);
2531
if (xmlUtil.
Reader
.AttributeCount != 1)
2540
string protectionProviderAttribute = xmlUtil.
Reader
.GetAttribute(ProtectionProviderAttribute);
2553
if (xmlUtil.
Reader
.AttributeCount != 1)
2568
if (!xmlUtil.
Reader
.IsEmptyElement)
2570
while (xmlUtil.
Reader
.Read())
2572
XmlNodeType t = xmlUtil.
Reader
.NodeType;
2625
if (xmlUtil.
Reader
.NodeType != XmlNodeType.Element)
2712
while (xmlUtil.
Reader
.MoveToNextAttribute())
2713
switch (xmlUtil.
Reader
.Name)
2716
locationSubPath = xmlUtil.
Reader
.Value;
2748
OverrideModeSetting.ParseOverrideModeXmlValue(xmlUtil.
Reader
.Value, xmlUtil));
2761
xmlUtil.
Reader
.MoveToElement(); // if on an attribute move back to the element
System\Configuration\MgmtConfigurationRecord.cs (5)
2183
if ((xmlUtil.
Reader
.NodeType == XmlNodeType.Element) && utilWriter.IsLastLineBlank)
2204
XmlTextReader reader = xmlUtil.
Reader
;
2377
XmlTextReader reader = xmlUtil.
Reader
;
2606
XmlTextReader reader = xmlUtil.
Reader
;
3074
XmlTextReader reader = xmlUtil.
Reader
;
System\Configuration\XmlUtil.cs (138)
78
Reader
.WhitespaceHandling = WhitespaceHandling.None;
81
while (!done &&
Reader
.Read())
82
switch (
Reader
.NodeType)
108
int trueLinePosition =
Reader
.LinePosition - GetPositionOffset(
Reader
.NodeType);
120
public int LineNumber =>
Reader
.LineNumber;
134
if (
Reader
!= null)
137
Reader
.Close();
156
while (
Reader
.Read())
157
if (
Reader
.MoveToContent() == XmlNodeType.Element)
171
Reader
.Skip();
172
Reader
.MoveToContent();
174
while (!
Reader
.EOF && (
Reader
.NodeType != XmlNodeType.Element))
176
Reader
.Read();
177
Reader
.MoveToContent();
186
while (
Reader
.Read())
189
if (
Reader
.NodeType == XmlNodeType.Element) return;
201
Reader
.Skip();
203
while (!
Reader
.EOF && (
Reader
.NodeType != XmlNodeType.Element))
206
Reader
.Read();
216
int currentDepth =
Reader
.Depth;
219
while (
Reader
.Depth >= currentDepth)
Reader
.Skip();
221
while (!
Reader
.EOF && (
Reader
.NodeType != XmlNodeType.EndElement))
224
Reader
.Read();
233
XmlNodeType nodeType =
Reader
.NodeType;
250
if (
Reader
.MoveToNextAttribute())
273
SR.Format(SR.Config_base_unrecognized_attribute,
Reader
.Name),
282
SR.Format(SR.Config_missing_required_attribute, attrib,
Reader
.Name),
291
SR.Format(SR.Config_reserved_attribute,
Reader
.Name),
308
if (!string.IsNullOrEmpty(
Reader
.Value)) newValue =
Reader
.Value;
314
SR.Format(SR.Empty_attribute,
Reader
.Name),
328
switch (
Reader
.Value)
339
new ConfigurationErrorsException(SR.Format(SR.Config_invalid_boolean_attribute,
Reader
.Name), this),
358
bool isEmptyElement =
Reader
.IsEmptyElement;
359
int startingLine =
Reader
.LineNumber;
361
int depth =
Reader
.Depth;
364
Debug.Assert(
Reader
.NodeType == XmlNodeType.Element, "Reader.NodeType == XmlNodeType.Element");
371
while (
Reader
.NodeType != XmlNodeType.EndElement)
372
if (
Reader
.NodeType == XmlNodeType.Element)
374
Reader
.Skip();
381
if (
Reader
.NodeType == XmlNodeType.Whitespace)
Reader
.Skip();
389
if (
Reader
.LineNumber != startingLine)
397
Debug.Assert(
Reader
.Depth == depth, "We should be at the same depth as the opening Element");
417
if (
Reader
.NodeType == XmlNodeType.EndElement)
420
depth =
Reader
.Depth;
427
if (
Reader
.NodeType == XmlNodeType.Element)
430
if (
Reader
.Depth < depth) break;
452
Debug.Assert(
Reader
.NodeType == XmlNodeType.Element, "_reader.NodeType == XmlNodeType.Element");
458
Reader
.Skip();
463
int depth = limitDepth ?
Reader
.Depth : 0;
466
Reader
.Skip();
468
int lineNumberOfEndElement =
Reader
.LineNumber;
471
while (!
Reader
.EOF)
473
if (
Reader
.NodeType != XmlNodeType.Whitespace)
478
if (
Reader
.LineNumber > lineNumberOfEndElement)
487
Reader
.Read();
491
while (!
Reader
.EOF)
493
if (
Reader
.NodeType == XmlNodeType.Element)
496
if (
Reader
.Depth < depth) break;
501
return !
Reader
.EOF;
507
Debug.Assert(
Reader
.NodeType == XmlNodeType.Element, "_reader.NodeType== XmlNodeType.Element");
509
int depth =
Reader
.Depth;
510
bool isEmptyElement =
Reader
.IsEmptyElement;
516
while (
Reader
.Depth > depth) CopyXmlNode(utilWriter);
554
readerLineNumber =
Reader
.LineNumber;
555
readerLinePosition =
Reader
.LinePosition;
561
XmlNodeType nodeType =
Reader
.NodeType;
562
if (nodeType == XmlNodeType.Whitespace) utilWriter.Write(
Reader
.Value);
567
close =
Reader
.IsEmptyElement ? "/>" : ">";
573
lineNumber =
Reader
.LineNumber;
574
linePosition =
Reader
.LinePosition +
Reader
.Name.Length;
577
utilWriter.Write(
Reader
.Name);
589
while (
Reader
.MoveToNextAttribute())
595
int attrLineNumber =
Reader
.LineNumber;
596
int attrLinePosition =
Reader
.LinePosition;
602
int charactersWritten = utilWriter.Write(
Reader
.Name);
604
charactersWritten += utilWriter.AppendAttributeValue(
Reader
);
621
lineNumber =
Reader
.LineNumber;
622
linePosition =
Reader
.LinePosition +
Reader
.Name.Length;
625
utilWriter.Write(
Reader
.Name);
629
if (nodeType == XmlNodeType.Comment) utilWriter.AppendComment(
Reader
.Value);
632
if (nodeType == XmlNodeType.Text) utilWriter.AppendEscapeTextString(
Reader
.Value);
643
lineNumber =
Reader
.LineNumber;
644
linePosition =
Reader
.LinePosition + 3;
658
while (
Reader
.MoveToNextAttribute())
664
int attrLineNumber =
Reader
.LineNumber;
665
int attrLinePosition =
Reader
.LinePosition;
672
int charactersWritten = utilWriter.Write(
Reader
.Name);
674
charactersWritten += utilWriter.AppendAttributeValue(
Reader
);
682
Reader
.MoveToElement();
686
if (nodeType == XmlNodeType.SignificantWhitespace) utilWriter.Write(
Reader
.Value);
701
utilWriter.AppendProcessingInstruction(
Reader
.Name,
Reader
.Value);
706
utilWriter.AppendEntityRef(
Reader
.Name);
710
utilWriter.AppendCData(
Reader
.Value);
728
_lastLinePosition + c,
Reader
.LineNumber,
729
Reader
.LinePosition);
732
utilWriter.Write(
Reader
.Name);
736
if (
Reader
.HasValue) dtdValue =
Reader
.Value;
742
lineNumber =
Reader
.LineNumber;
743
linePosition =
Reader
.LinePosition +
Reader
.Name.Length;
746
if (
Reader
.MoveToFirstAttribute())
750
Reader
.LineNumber,
Reader
.LinePosition);
753
string attrName =
Reader
.Name;
756
utilWriter.AppendAttributeValue(
Reader
);
757
Reader
.MoveToAttribute(0);
762
Reader
.MoveToAttribute(1);
764
utilWriter.AppendAttributeValue(
Reader
);
765
Reader
.MoveToAttribute(1);
791
bool moreToRead =
Reader
.Read();
792
nodeType =
Reader
.NodeType;
802
int closeLineNumber =
Reader
.LineNumber;
803
int closeLinePosition =
Reader
.LinePosition - startOffset - close.Length;
831
Debug.Assert(
Reader
.NodeType == XmlNodeType.Element,
837
element.Append(
Reader
.Name);
840
while (
Reader
.MoveToNextAttribute())
843
element.Append(
Reader
.Name);
846
element.Append(
Reader
.Value);
866
Debug.Assert(
Reader
.NodeType == XmlNodeType.Element, "_reader.NodeType == NodeType.Element");
871
string elementName =
Reader
.Name;
874
if (
Reader
.IsEmptyElement)
913
Reader
.Read();
939
WhitespaceHandling originalHandling =
Reader
.WhitespaceHandling;
940
Reader
.WhitespaceHandling = WhitespaceHandling.All;
949
Reader
.WhitespaceHandling = originalHandling;
952
(
Reader
.NodeType == XmlNodeType.Whitespace))
956
Reader
.Read();