Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlBaseReader.cs
Go to the documentation of this file.
3using System.IO;
5using System.Text;
6
7namespace System.Xml;
8
9internal abstract class XmlBaseReader : XmlDictionaryReader
10{
11 protected enum QNameType
12 {
13 Normal,
14 Xmlns
15 }
16
17 protected class XmlNode
18 {
19 protected enum XmlNodeFlags
20 {
21 None = 0,
24 HasValue = 4,
25 AtomicValue = 8,
26 SkipValue = 0x10,
27 HasContent = 0x20
28 }
29
31
32 private readonly PrefixHandle _prefix;
33
34 private readonly StringHandle _localName;
35
36 private readonly ValueHandle _value;
37
38 private Namespace _ns;
39
40 private readonly bool _hasValue;
41
42 private readonly bool _canGetAttribute;
43
44 private readonly bool _canMoveToElement;
45
46 private readonly ReadState _readState;
47
49
50 private bool _exitScope;
51
52 private readonly int _depthDelta;
53
54 private bool _isAtomicValue;
55
56 private readonly bool _skipValue;
57
59
60 private readonly bool _hasContent;
61
62 private bool _isEmptyElement;
63
64 private char _quoteChar;
65
66 public bool HasValue => _hasValue;
67
69
71
73
75
77
79
80 public bool SkipValue => _skipValue;
81
83
84 public int DepthDelta => _depthDelta;
85
86 public bool HasContent => _hasContent;
87
89 {
90 get
91 {
92 return _nodeType;
93 }
94 set
95 {
97 }
98 }
99
101 {
102 get
103 {
104 return _qnameType;
105 }
106 set
107 {
109 }
110 }
111
113 {
114 get
115 {
116 return _ns;
117 }
118 set
119 {
120 _ns = value;
121 }
122 }
123
124 public bool IsAtomicValue
125 {
126 get
127 {
128 return _isAtomicValue;
129 }
130 set
131 {
133 }
134 }
135
136 public bool ExitScope
137 {
138 get
139 {
140 return _exitScope;
141 }
142 set
143 {
145 }
146 }
147
148 public bool IsEmptyElement
149 {
150 get
151 {
152 return _isEmptyElement;
153 }
154 set
155 {
157 }
158 }
159
160 public char QuoteChar
161 {
162 get
163 {
164 return _quoteChar;
165 }
166 set
167 {
169 }
170 }
171
172 public string ValueAsString
173 {
174 get
175 {
176 if (_qnameType == QNameType.Normal)
177 {
178 return Value.GetString();
179 }
180 return Namespace.Uri.GetString();
181 }
182 }
183
185 {
186 _nodeType = nodeType;
187 _prefix = prefix;
188 _localName = localName;
189 _value = value;
191 _hasValue = (nodeFlags & XmlNodeFlags.HasValue) != 0;
192 _canGetAttribute = (nodeFlags & XmlNodeFlags.CanGetAttribute) != 0;
193 _canMoveToElement = (nodeFlags & XmlNodeFlags.CanMoveToElement) != 0;
194 _isAtomicValue = (nodeFlags & XmlNodeFlags.AtomicValue) != 0;
195 _skipValue = (nodeFlags & XmlNodeFlags.SkipValue) != 0;
196 _hasContent = (nodeFlags & XmlNodeFlags.HasContent) != 0;
199 _exitScope = nodeType == XmlNodeType.EndElement;
201 _isEmptyElement = false;
202 _quoteChar = '"';
203 _qnameType = QNameType.Normal;
204 }
205
206 public bool IsLocalName(string localName)
207 {
208 if (_qnameType == QNameType.Normal)
209 {
210 return LocalName == localName;
211 }
212 return Namespace.Prefix == localName;
213 }
214
215 public bool IsLocalName(XmlDictionaryString localName)
216 {
217 if (_qnameType == QNameType.Normal)
218 {
219 return LocalName == localName;
220 }
221 return Namespace.Prefix == localName;
222 }
223
224 public bool IsNamespaceUri(string ns)
225 {
226 if (_qnameType == QNameType.Normal)
227 {
228 return Namespace.IsUri(ns);
229 }
230 return ns == "http://www.w3.org/2000/xmlns/";
231 }
232
234 {
235 if (_qnameType == QNameType.Normal)
236 {
237 return Namespace.IsUri(ns);
238 }
239 return ns.Value == "http://www.w3.org/2000/xmlns/";
240 }
241
242 public bool IsLocalNameAndNamespaceUri(string localName, string ns)
243 {
244 if (_qnameType == QNameType.Normal)
245 {
246 if (LocalName == localName)
247 {
248 return Namespace.IsUri(ns);
249 }
250 return false;
251 }
252 if (Namespace.Prefix == localName)
253 {
254 return ns == "http://www.w3.org/2000/xmlns/";
255 }
256 return false;
257 }
258
260 {
261 if (_qnameType == QNameType.Normal)
262 {
263 if (LocalName == localName)
264 {
265 return Namespace.IsUri(ns);
266 }
267 return false;
268 }
269 if (Namespace.Prefix == localName)
270 {
271 return ns.Value == "http://www.w3.org/2000/xmlns/";
272 }
273 return false;
274 }
275
276 public bool IsPrefixAndLocalName(string prefix, string localName)
277 {
278 if (_qnameType == QNameType.Normal)
279 {
280 if (Prefix == prefix)
281 {
282 return LocalName == localName;
283 }
284 return false;
285 }
286 if (prefix == "xmlns")
287 {
288 return Namespace.Prefix == localName;
289 }
290 return false;
291 }
292
294 {
295 if (_qnameType == QNameType.Normal)
296 {
297 return LocalName.TryGetDictionaryString(out localName);
298 }
299 localName = null;
300 return false;
301 }
302
304 {
305 if (_qnameType == QNameType.Normal)
306 {
308 }
309 ns = null;
310 return false;
311 }
312
314 {
315 if (_qnameType == QNameType.Normal)
316 {
318 }
319 value = null;
320 return false;
321 }
322 }
323
324 protected class XmlElementNode : XmlNode
325 {
327
328 private int _bufferOffset;
329
330 public int NameOffset;
331
332 public int NameLength;
333
335
336 public int BufferOffset
337 {
338 get
339 {
340 return _bufferOffset;
341 }
342 set
343 {
345 }
346 }
347
352
358 }
359
372
380
388
396
404
412
420
422 {
427 }
428
436
444
452
460
468
469 private sealed class AttributeSorter : IComparer
470 {
471 private object[] _indeces;
472
474
475 private int _attributeCount;
476
477 private int _attributeIndex1;
478
479 private int _attributeIndex2;
480
481 public bool Sort(XmlAttributeNode[] attributeNodes, int attributeCount)
482 {
483 _attributeIndex1 = -1;
484 _attributeIndex2 = -1;
486 _attributeCount = attributeCount;
487 bool result = Sort();
488 _attributeNodes = null;
489 _attributeCount = 0;
490 return result;
491 }
492
498
499 public void Close()
500 {
501 if (_indeces != null && _indeces.Length > 32)
502 {
503 _indeces = null;
504 }
505 }
506
507 private bool Sort()
508 {
509 if (_indeces != null && _indeces.Length == _attributeCount && IsSorted())
510 {
511 return true;
512 }
513 object[] array = new object[_attributeCount];
514 for (int i = 0; i < array.Length; i++)
515 {
516 array[i] = i;
517 }
518 _indeces = array;
520 return IsSorted();
521 }
522
523 private bool IsSorted()
524 {
525 for (int i = 0; i < _indeces.Length - 1; i++)
526 {
527 if (Compare(_indeces[i], _indeces[i + 1]) >= 0)
528 {
529 _attributeIndex1 = (int)_indeces[i];
530 _attributeIndex2 = (int)_indeces[i + 1];
531 return false;
532 }
533 }
534 return true;
535 }
536
537 public int Compare(object obj1, object obj2)
538 {
539 int num = (int)obj1;
540 int num2 = (int)obj2;
543 int num3 = CompareQNameType(xmlAttributeNode.QNameType, xmlAttributeNode2.QNameType);
544 if (num3 == 0)
545 {
546 if (xmlAttributeNode.QNameType == QNameType.Normal)
547 {
548 num3 = xmlAttributeNode.LocalName.CompareTo(xmlAttributeNode2.LocalName);
549 if (num3 == 0)
550 {
551 num3 = xmlAttributeNode.Namespace.Uri.CompareTo(xmlAttributeNode2.Namespace.Uri);
552 }
553 }
554 else
555 {
556 num3 = xmlAttributeNode.Namespace.Prefix.CompareTo(xmlAttributeNode2.Namespace.Prefix);
557 }
558 }
559 return num3;
560 }
561
563 {
564 return type1 - type2;
565 }
566 }
567
568 private sealed class NamespaceManager
569 {
570 private sealed class XmlAttribute
571 {
573
574 private string _lang = string.Empty;
575
576 private int _depth;
577
578 public int Depth
579 {
580 get
581 {
582 return _depth;
583 }
584 set
585 {
586 _depth = value;
587 }
588 }
589
590 public string XmlLang
591 {
592 get
593 {
594 return _lang;
595 }
596 set
597 {
598 _lang = value;
599 }
600 }
601
603 {
604 get
605 {
606 return _space;
607 }
608 set
609 {
610 _space = value;
611 }
612 }
613 }
614
616
618
619 private int _nsCount;
620
621 private int _depth;
622
623 private readonly Namespace[] _shortPrefixUri;
624
626
627 private static Namespace s_xmlNamespace;
628
630
631 private int _attributeCount;
632
634
635 private string _lang;
636
638 {
639 get
640 {
641 if (s_xmlNamespace == null)
642 {
643 byte[] array = new byte[39]
644 {
645 120, 109, 108, 104, 116, 116, 112, 58, 47, 47,
646 119, 119, 119, 46, 119, 51, 46, 111, 114, 103,
647 47, 88, 77, 76, 47, 49, 57, 57, 56, 47,
648 110, 97, 109, 101, 115, 112, 97, 99, 101
649 };
651 @namespace.Prefix.SetValue(0, 3);
652 @namespace.Uri.SetValue(3, array.Length - 3);
653 s_xmlNamespace = @namespace;
654 }
655 return s_xmlNamespace;
656 }
657 }
658
660
661 public string XmlLang => _lang;
662
664
666 {
668 _shortPrefixUri = new Namespace[28];
670 _namespaces = null;
671 _nsCount = 0;
672 _attributes = null;
673 _attributeCount = 0;
674 _space = XmlSpace.None;
675 _lang = string.Empty;
676 _depth = 0;
677 }
678
679 public void Close()
680 {
681 if (_namespaces != null && _namespaces.Length > 32)
682 {
683 _namespaces = null;
684 }
685 if (_attributes != null && _attributes.Length > 4)
686 {
687 _attributes = null;
688 }
689 _lang = string.Empty;
690 }
691
692 public void Clear()
693 {
694 if (_nsCount != 0)
695 {
696 for (int i = 0; i < _shortPrefixUri.Length; i++)
697 {
698 _shortPrefixUri[i] = null;
699 }
701 _nsCount = 0;
702 }
703 _attributeCount = 0;
704 _space = XmlSpace.None;
705 _lang = string.Empty;
706 _depth = 0;
707 }
708
709 public void EnterScope()
710 {
711 _depth++;
712 }
713
714 public void ExitScope()
715 {
716 while (_nsCount > 0)
717 {
718 Namespace @namespace = _namespaces[_nsCount - 1];
719 if (@namespace.Depth != _depth)
720 {
721 break;
722 }
723 if (@namespace.Prefix.TryGetShortPrefix(out var type))
724 {
725 _shortPrefixUri[(int)type] = @namespace.OuterUri;
726 }
727 _nsCount--;
728 }
729 while (_attributeCount > 0)
730 {
732 if (xmlAttribute.Depth != _depth)
733 {
734 break;
735 }
737 _lang = xmlAttribute.XmlLang;
739 }
740 _depth--;
741 }
742
744 {
745 for (int i = 0; i < _nsCount; i++)
746 {
748 bool flag = false;
749 for (int j = i + 1; j < _nsCount; j++)
750 {
751 if (object.Equals(prefix, _namespaces[j].Prefix))
752 {
753 flag = true;
754 break;
755 }
756 }
757 if (!flag)
758 {
759 int offset;
760 int length;
761 byte[] @string = prefix.GetString(out offset, out length);
762 int offset2;
763 int length2;
765 writer.WriteXmlnsAttribute(@string, offset, length, string2, offset2, length2);
766 }
767 }
768 }
769
770 public void AddLangAttribute(string lang)
771 {
772 AddAttribute();
773 _lang = lang;
774 }
775
777 {
778 AddAttribute();
779 _space = space;
780 }
781
805
806 public void Register(Namespace nameSpace)
807 {
808 if (nameSpace.Prefix.TryGetShortPrefix(out var type))
809 {
811 _shortPrefixUri[(int)type] = nameSpace;
812 }
813 else
814 {
815 nameSpace.OuterUri = null;
816 }
817 }
818
820 {
821 if (_namespaces == null)
822 {
823 _namespaces = new Namespace[4];
824 }
825 else if (_namespaces.Length == _nsCount)
826 {
827 Namespace[] array = new Namespace[_nsCount * 2];
830 }
831 Namespace @namespace = _namespaces[_nsCount];
832 if (@namespace == null)
833 {
834 @namespace = new Namespace(_bufferReader);
835 _namespaces[_nsCount] = @namespace;
836 }
837 @namespace.Clear();
839 _nsCount++;
840 return @namespace;
841 }
842
847
849 {
850 if (prefix.TryGetShortPrefix(out var type))
851 {
852 return LookupNamespace(type);
853 }
854 for (int num = _nsCount - 1; num >= 0; num--)
855 {
856 Namespace @namespace = _namespaces[num];
857 if (@namespace.Prefix == prefix)
858 {
859 return @namespace;
860 }
861 }
862 if (prefix.IsXml)
863 {
864 return XmlNamespace;
865 }
866 return null;
867 }
868
870 {
872 {
874 }
875 for (int num = _nsCount - 1; num >= 0; num--)
876 {
877 Namespace @namespace = _namespaces[num];
878 if (@namespace.Prefix == prefix)
879 {
880 return @namespace;
881 }
882 }
883 if (prefix == "xml")
884 {
885 return XmlNamespace;
886 }
887 return null;
888 }
889
891 {
892 switch (s.Length)
893 {
894 case 0:
896 return true;
897 case 1:
898 {
899 char c = s[0];
900 if (c >= 'a' && c <= 'z')
901 {
903 return true;
904 }
905 break;
906 }
907 }
909 return false;
910 }
911 }
912
913 protected class Namespace
914 {
915 private readonly PrefixHandle _prefix;
916
917 private readonly StringHandle _uri;
918
919 private int _depth;
920
922
923 private string _uriString;
924
925 public int Depth
926 {
927 get
928 {
929 return _depth;
930 }
931 set
932 {
933 _depth = value;
934 }
935 }
936
937 public PrefixHandle Prefix => _prefix;
938
939 public StringHandle Uri => _uri;
940
941 public Namespace OuterUri
942 {
943 get
944 {
945 return _outerUri;
946 }
947 set
948 {
949 _outerUri = value;
950 }
951 }
952
954 {
955 _prefix = new PrefixHandle(bufferReader);
956 _uri = new StringHandle(bufferReader);
957 _outerUri = null;
958 _uriString = null;
959 }
960
961 public void Clear()
962 {
963 _uriString = null;
964 }
965
966 public bool IsUri(string s)
967 {
968 if ((object)s == _uriString)
969 {
970 return true;
971 }
972 if (_uri == s)
973 {
974 _uriString = s;
975 return true;
976 }
977 return false;
978 }
979
981 {
982 if ((object)s.Value == _uriString)
983 {
984 return true;
985 }
986 if (_uri == s)
987 {
988 _uriString = s.Value;
989 return true;
990 }
991 return false;
992 }
993 }
994
996
997 private XmlNode _node;
998
999 private readonly NamespaceManager _nsMgr;
1000
1002
1004
1006
1007 private int _depth;
1008
1009 private int _attributeCount;
1010
1011 private int _attributeStart;
1012
1014
1016
1018
1020
1022
1024
1026
1028
1029 private int _attributeIndex;
1030
1031 private char[] _chars;
1032
1033 private string _prefix;
1034
1035 private string _localName;
1036
1037 private string _ns;
1038
1039 private string _value;
1040
1041 private int _trailCharCount;
1042
1043 private int _trailByteCount;
1044
1045 private char[] _trailChars;
1046
1047 private byte[] _trailBytes;
1048
1049 private bool _rootElement;
1050
1051 private bool _readingElement;
1052
1054
1056
1058
1060
1062
1064
1065 private const string xmlns = "xmlns";
1066
1067 private const string xml = "xml";
1068
1069 private const string xmlnsNamespace = "http://www.w3.org/2000/xmlns/";
1070
1071 private const string xmlNamespace = "http://www.w3.org/XML/1998/namespace";
1072
1074
1075 private bool _signing;
1076
1078 {
1079 get
1080 {
1081 if (s_base64Encoding == null)
1082 {
1084 }
1085 return s_base64Encoding;
1086 }
1087 }
1088
1090 {
1091 get
1092 {
1093 if (s_binHexEncoding == null)
1094 {
1096 }
1097 return s_binHexEncoding;
1098 }
1099 }
1100
1102
1104
1105 protected XmlNode Node => _node;
1106
1108 {
1109 get
1110 {
1111 if (_depth == 0)
1112 {
1113 return _rootElementNode;
1114 }
1115 return _elementNodes[_depth];
1116 }
1117 }
1118
1119 protected bool OutsideRootElement => _depth == 0;
1120
1121 public override bool CanReadBinaryContent => true;
1122
1123 public override bool CanReadValueChunk => true;
1124
1125 public override string BaseURI => string.Empty;
1126
1127 public override bool HasValue => _node.HasValue;
1128
1129 public override bool IsDefault => false;
1130
1131 public override string this[int index] => GetAttribute(index);
1132
1133 public override string this[string name] => GetAttribute(name);
1134
1135 public override string this[string localName, string namespaceUri] => GetAttribute(localName, namespaceUri);
1136
1137 public override int AttributeCount
1138 {
1139 get
1140 {
1142 {
1143 return _attributeCount;
1144 }
1145 return 0;
1146 }
1147 }
1148
1149 public sealed override int Depth => _depth + _node.DepthDelta;
1150
1151 public override bool EOF => _node.ReadState == ReadState.EndOfFile;
1152
1153 public sealed override bool IsEmptyElement => _node.IsEmptyElement;
1154
1155 public override string LocalName
1156 {
1157 get
1158 {
1159 if (_localName == null)
1160 {
1161 if (_node.QNameType == QNameType.Normal)
1162 {
1164 }
1165 else if (_node.Namespace.Prefix.IsEmpty)
1166 {
1167 _localName = "xmlns";
1168 }
1169 else
1170 {
1172 }
1173 }
1174 return _localName;
1175 }
1176 }
1177
1178 public override string NamespaceURI
1179 {
1180 get
1181 {
1182 if (_ns == null)
1183 {
1184 if (_node.QNameType == QNameType.Normal)
1185 {
1187 }
1188 else
1189 {
1190 _ns = "http://www.w3.org/2000/xmlns/";
1191 }
1192 }
1193 return _ns;
1194 }
1195 }
1196
1197 public override XmlNameTable NameTable
1198 {
1199 get
1200 {
1201 if (_nameTable == null)
1202 {
1203 _nameTable = new NameTable();
1204 _nameTable.Add("xml");
1205 _nameTable.Add("xmlns");
1206 _nameTable.Add("http://www.w3.org/2000/xmlns/");
1207 _nameTable.Add("http://www.w3.org/XML/1998/namespace");
1209 {
1211 }
1212 }
1213 return _nameTable;
1214 }
1215 }
1216
1217 public sealed override XmlNodeType NodeType => _node.NodeType;
1218
1219 public override string Prefix
1220 {
1221 get
1222 {
1223 if (_prefix == null)
1224 {
1225 switch (_node.QNameType)
1226 {
1227 case QNameType.Normal:
1229 break;
1230 case QNameType.Xmlns:
1232 {
1233 _prefix = string.Empty;
1234 }
1235 else
1236 {
1237 _prefix = "xmlns";
1238 }
1239 break;
1240 default:
1241 _prefix = "xml";
1242 break;
1243 }
1244 }
1245 return _prefix;
1246 }
1247 }
1248
1250
1251 public override string Value
1252 {
1253 get
1254 {
1255 if (_value == null)
1256 {
1258 }
1259 return _value;
1260 }
1261 }
1262
1263 public override Type ValueType
1264 {
1265 get
1266 {
1267 if (_value == null && _node.QNameType == QNameType.Normal)
1268 {
1270 if (_node.IsAtomicValue)
1271 {
1272 return type;
1273 }
1274 if (type == typeof(byte[]))
1275 {
1276 return type;
1277 }
1278 }
1279 return typeof(string);
1280 }
1281 }
1282
1283 public override string XmlLang => _nsMgr.XmlLang;
1284
1285 public override XmlSpace XmlSpace => _nsMgr.XmlSpace;
1286
1287 public override bool CanCanonicalize => true;
1288
1289 protected bool Signing => _signing;
1290
1300
1301 protected void MoveToNode(XmlNode node)
1302 {
1303 _node = node;
1304 _ns = null;
1305 _localName = null;
1306 _prefix = null;
1307 _value = null;
1308 }
1309
1311 {
1312 if (quotas == null)
1313 {
1315 }
1316 quotas.InternalCopyTo(_quotas);
1318 _nsMgr.Clear();
1319 _depth = 0;
1320 _attributeCount = 0;
1321 _attributeStart = -1;
1322 _attributeIndex = -1;
1323 _rootElement = false;
1324 _readingElement = false;
1326 }
1327
1329 {
1330 if (_attributeCount < 1)
1331 {
1333 }
1334 if (_attributeCount > 3)
1335 {
1337 }
1338 if (!CheckDeclAttribute(0, "version", "1.0", checkLower: false, System.SR.XmlInvalidVersion))
1339 {
1341 }
1342 if (_attributeCount > 1)
1343 {
1344 if (CheckDeclAttribute(1, "encoding", null, checkLower: true, System.SR.XmlInvalidEncoding_UTF8))
1345 {
1346 if (_attributeCount == 3 && !CheckStandalone(2))
1347 {
1349 }
1350 }
1351 else if (!CheckStandalone(1) || _attributeCount > 2)
1352 {
1354 }
1355 }
1356 if (_declarationNode == null)
1357 {
1359 }
1361 return _declarationNode;
1362 }
1363
1364 private bool CheckStandalone(int attr)
1365 {
1367 if (!xmlAttributeNode.Prefix.IsEmpty)
1368 {
1370 }
1371 if (xmlAttributeNode.LocalName != "standalone")
1372 {
1373 return false;
1374 }
1375 if (!xmlAttributeNode.Value.Equals2("yes", checkLower: false) && !xmlAttributeNode.Value.Equals2("no", checkLower: false))
1376 {
1378 }
1379 return true;
1380 }
1381
1382 private bool CheckDeclAttribute(int index, string localName, string value, bool checkLower, string valueSR)
1383 {
1385 if (!xmlAttributeNode.Prefix.IsEmpty)
1386 {
1388 }
1389 if (xmlAttributeNode.LocalName != localName)
1390 {
1391 return false;
1392 }
1393 if (value != null && !xmlAttributeNode.Value.Equals2(value, checkLower))
1394 {
1396 }
1397 return true;
1398 }
1399
1401 {
1402 if (_commentNode == null)
1403 {
1405 }
1407 return _commentNode;
1408 }
1409
1411 {
1412 if (_cdataNode == null)
1413 {
1415 }
1417 return _cdataNode;
1418 }
1419
1426
1428 {
1429 if (_complexTextNode == null)
1430 {
1432 }
1434 return _complexTextNode;
1435 }
1436
1438 {
1439 if (_whitespaceTextNode == null)
1440 {
1442 }
1443 if (_nsMgr.XmlSpace == XmlSpace.Preserve)
1444 {
1445 _whitespaceTextNode.NodeType = XmlNodeType.SignificantWhitespace;
1446 }
1447 else
1448 {
1450 }
1452 return _whitespaceTextNode;
1453 }
1454
1466
1467 protected void MoveToEndOfFile()
1468 {
1469 if (_depth != 0)
1470 {
1472 }
1474 }
1475
1477 {
1478 if (_depth == 0)
1479 {
1480 if (_rootElement)
1481 {
1483 }
1484 _rootElement = true;
1485 }
1487 _depth++;
1488 if (_depth > _quotas.MaxDepth)
1489 {
1491 }
1492 if (_elementNodes == null)
1493 {
1495 }
1496 else if (_elementNodes.Length == _depth)
1497 {
1501 }
1503 if (xmlElementNode == null)
1504 {
1507 }
1508 _attributeCount = 0;
1509 _attributeStart = -1;
1510 _attributeIndex = -1;
1512 return xmlElementNode;
1513 }
1514
1515 protected void ExitScope()
1516 {
1517 if (_depth == 0)
1518 {
1520 }
1521 _depth--;
1522 _nsMgr.ExitScope();
1523 }
1524
1526 {
1527 int attributeCount = _attributeCount;
1528 if (_attributeNodes == null)
1529 {
1531 }
1532 else if (_attributeNodes.Length == attributeCount)
1533 {
1534 XmlAttributeNode[] array = new XmlAttributeNode[attributeCount * 2];
1535 Array.Copy(_attributeNodes, array, attributeCount);
1537 }
1539 if (xmlAttributeNode == null)
1540 {
1542 _attributeNodes[attributeCount] = xmlAttributeNode;
1543 }
1549 return xmlAttributeNode;
1550 }
1551
1553 {
1554 return _nsMgr.AddNamespace();
1555 }
1556
1558 {
1559 return AddAttribute(QNameType.Normal, isAtomicValue: true);
1560 }
1561
1563 {
1564 return AddAttribute(QNameType.Normal, isAtomicValue: true);
1565 }
1566
1568 {
1569 if (!ns.Prefix.IsEmpty && ns.Uri.IsEmpty)
1570 {
1572 }
1573 if (ns.Prefix.IsXml && ns.Uri != "http://www.w3.org/XML/1998/namespace")
1574 {
1575 XmlExceptionHelper.ThrowXmlException(this, new XmlException(System.SR.Format(System.SR.XmlSpecificBindingPrefix, "xml", "http://www.w3.org/XML/1998/namespace")));
1576 }
1577 else if (ns.Prefix.IsXmlns && ns.Uri != "http://www.w3.org/2000/xmlns/")
1578 {
1579 XmlExceptionHelper.ThrowXmlException(this, new XmlException(System.SR.Format(System.SR.XmlSpecificBindingPrefix, "xmlns", "http://www.w3.org/2000/xmlns/")));
1580 }
1581 _nsMgr.Register(ns);
1585 return xmlAttributeNode;
1586 }
1587
1589 {
1590 if (!(attributeNode.Prefix == "xml"))
1591 {
1592 return;
1593 }
1594 if (attributeNode.LocalName == "lang")
1595 {
1596 _nsMgr.AddLangAttribute(attributeNode.Value.GetString());
1597 }
1598 else if (attributeNode.LocalName == "space")
1599 {
1600 string @string = attributeNode.Value.GetString();
1601 if (@string == "preserve")
1602 {
1604 }
1605 else if (@string == "default")
1606 {
1608 }
1609 }
1610 }
1611
1612 public override void Close()
1613 {
1615 _nameTable = null;
1616 if (_attributeNodes != null && _attributeNodes.Length > 16)
1617 {
1618 _attributeNodes = null;
1619 }
1620 if (_elementNodes != null && _elementNodes.Length > 16)
1621 {
1622 _elementNodes = null;
1623 }
1624 _nsMgr.Close();
1626 if (_signingWriter != null)
1627 {
1629 }
1630 if (_attributeSorter != null)
1631 {
1633 }
1634 }
1635
1652
1654 {
1655 if (name == null)
1656 {
1658 }
1660 {
1661 return null;
1662 }
1663 int num = name.IndexOf(':');
1664 string prefix;
1665 string localName;
1666 if (num == -1)
1667 {
1668 if (name == "xmlns")
1669 {
1670 prefix = "xmlns";
1671 localName = string.Empty;
1672 }
1673 else
1674 {
1675 prefix = string.Empty;
1676 localName = name;
1677 }
1678 }
1679 else
1680 {
1681 prefix = name.Substring(0, num);
1682 localName = name.Substring(num + 1);
1683 }
1685 int attributeCount = _attributeCount;
1686 int num2 = _attributeStart;
1687 for (int i = 0; i < attributeCount; i++)
1688 {
1689 if (++num2 >= attributeCount)
1690 {
1691 num2 = 0;
1692 }
1694 if (xmlAttributeNode.IsPrefixAndLocalName(prefix, localName))
1695 {
1697 return xmlAttributeNode;
1698 }
1699 }
1700 return null;
1701 }
1702
1703 private XmlAttributeNode GetAttributeNode(string localName, string namespaceUri)
1704 {
1705 if (localName == null)
1706 {
1708 }
1709 if (namespaceUri == null)
1710 {
1711 namespaceUri = string.Empty;
1712 }
1714 {
1715 return null;
1716 }
1718 int attributeCount = _attributeCount;
1719 int num = _attributeStart;
1720 for (int i = 0; i < attributeCount; i++)
1721 {
1722 if (++num >= attributeCount)
1723 {
1724 num = 0;
1725 }
1727 if (xmlAttributeNode.IsLocalNameAndNamespaceUri(localName, namespaceUri))
1728 {
1729 _attributeStart = num;
1730 return xmlAttributeNode;
1731 }
1732 }
1733 return null;
1734 }
1735
1737 {
1738 if (localName == null)
1739 {
1741 }
1742 if (namespaceUri == null)
1743 {
1744 namespaceUri = XmlDictionaryString.Empty;
1745 }
1747 {
1748 return null;
1749 }
1751 int attributeCount = _attributeCount;
1752 int num = _attributeStart;
1753 for (int i = 0; i < attributeCount; i++)
1754 {
1755 if (++num >= attributeCount)
1756 {
1757 num = 0;
1758 }
1760 if (xmlAttributeNode.IsLocalNameAndNamespaceUri(localName, namespaceUri))
1761 {
1762 _attributeStart = num;
1763 return xmlAttributeNode;
1764 }
1765 }
1766 return null;
1767 }
1768
1769 public override string GetAttribute(int index)
1770 {
1772 }
1773
1774 public override string GetAttribute(string name)
1775 {
1776 return GetAttributeNode(name)?.ValueAsString;
1777 }
1778
1779 public override string GetAttribute(string localName, string namespaceUri)
1780 {
1781 return GetAttributeNode(localName, namespaceUri)?.ValueAsString;
1782 }
1783
1784 public override string GetAttribute(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
1785 {
1786 return GetAttributeNode(localName, namespaceUri)?.ValueAsString;
1787 }
1788
1789 public override string LookupNamespace(string prefix)
1790 {
1792 if (@namespace != null)
1793 {
1794 return @namespace.Uri.GetString(NameTable);
1795 }
1796 if (prefix == "xmlns")
1797 {
1798 return "http://www.w3.org/2000/xmlns/";
1799 }
1800 return null;
1801 }
1802
1804 {
1806 if (@namespace == null)
1807 {
1809 }
1810 return @namespace;
1811 }
1812
1814 {
1816 if (@namespace == null)
1817 {
1819 }
1820 return @namespace;
1821 }
1822
1823 protected void ProcessAttributes()
1824 {
1825 if (_attributeCount > 0)
1826 {
1828 }
1829 }
1830
1831 private void ProcessAttributes(XmlAttributeNode[] attributeNodes, int attributeCount)
1832 {
1833 for (int i = 0; i < attributeCount; i++)
1834 {
1836 if (xmlAttributeNode.QNameType == QNameType.Normal)
1837 {
1839 if (!prefix.IsEmpty)
1840 {
1842 }
1843 else
1844 {
1846 }
1848 }
1849 }
1850 if (attributeCount <= 1)
1851 {
1852 return;
1853 }
1854 if (attributeCount < 12)
1855 {
1856 for (int j = 0; j < attributeCount - 1; j++)
1857 {
1859 if (xmlAttributeNode2.QNameType == QNameType.Normal)
1860 {
1861 for (int k = j + 1; k < attributeCount; k++)
1862 {
1864 if (xmlAttributeNode3.QNameType == QNameType.Normal && xmlAttributeNode2.LocalName == xmlAttributeNode3.LocalName && xmlAttributeNode2.Namespace.Uri == xmlAttributeNode3.Namespace.Uri)
1865 {
1866 XmlExceptionHelper.ThrowDuplicateAttribute(this, xmlAttributeNode2.Prefix.GetString(), xmlAttributeNode3.Prefix.GetString(), xmlAttributeNode2.LocalName.GetString(), xmlAttributeNode2.Namespace.Uri.GetString());
1867 }
1868 }
1869 continue;
1870 }
1871 for (int l = j + 1; l < attributeCount; l++)
1872 {
1874 if (xmlAttributeNode4.QNameType == QNameType.Xmlns && xmlAttributeNode2.Namespace.Prefix == xmlAttributeNode4.Namespace.Prefix)
1875 {
1876 XmlExceptionHelper.ThrowDuplicateAttribute(this, "xmlns", "xmlns", xmlAttributeNode2.Namespace.Prefix.GetString(), "http://www.w3.org/2000/xmlns/");
1877 }
1878 }
1879 }
1880 }
1881 else
1882 {
1883 CheckAttributes(attributeNodes, attributeCount);
1884 }
1885 }
1886
1887 private void CheckAttributes(XmlAttributeNode[] attributeNodes, int attributeCount)
1888 {
1889 if (_attributeSorter == null)
1890 {
1892 }
1893 if (!_attributeSorter.Sort(attributeNodes, attributeCount))
1894 {
1897 {
1899 }
1900 else
1901 {
1902 XmlExceptionHelper.ThrowDuplicateAttribute(this, attributeNodes[attributeIndex].Prefix.GetString(), attributeNodes[attributeIndex2].Prefix.GetString(), attributeNodes[attributeIndex].LocalName.GetString(), attributeNodes[attributeIndex].Namespace.Uri.GetString());
1903 }
1904 }
1905 }
1906
1907 public override void MoveToAttribute(int index)
1908 {
1910 }
1911
1912 public override bool MoveToAttribute(string name)
1913 {
1915 if (attributeNode == null)
1916 {
1917 return false;
1918 }
1920 return true;
1921 }
1922
1923 public override bool MoveToAttribute(string localName, string namespaceUri)
1924 {
1925 XmlNode attributeNode = GetAttributeNode(localName, namespaceUri);
1926 if (attributeNode == null)
1927 {
1928 return false;
1929 }
1931 return true;
1932 }
1933
1934 public override bool MoveToElement()
1935 {
1937 {
1938 return false;
1939 }
1940 if (_depth == 0)
1941 {
1943 }
1944 else
1945 {
1947 }
1948 _attributeIndex = -1;
1949 return true;
1950 }
1951
1952 public override XmlNodeType MoveToContent()
1953 {
1954 do
1955 {
1956 if (_node.HasContent)
1957 {
1958 if ((_node.NodeType != XmlNodeType.Text && _node.NodeType != XmlNodeType.CDATA) || _trailByteCount > 0)
1959 {
1960 break;
1961 }
1962 if (_value == null)
1963 {
1964 if (!_node.Value.IsWhitespace())
1965 {
1966 break;
1967 }
1968 }
1969 else if (!XmlConverter.IsWhitespace(_value))
1970 {
1971 break;
1972 }
1973 }
1974 else if (_node.NodeType == XmlNodeType.Attribute)
1975 {
1976 MoveToElement();
1977 break;
1978 }
1979 }
1980 while (Read());
1981 return _node.NodeType;
1982 }
1983
1984 public override bool MoveToFirstAttribute()
1985 {
1987 {
1988 return false;
1989 }
1991 _attributeIndex = 0;
1992 return true;
1993 }
1994
1995 public override bool MoveToNextAttribute()
1996 {
1998 {
1999 return false;
2000 }
2001 int num = _attributeIndex + 1;
2002 if (num >= _attributeCount)
2003 {
2004 return false;
2005 }
2007 _attributeIndex = num;
2008 return true;
2009 }
2010
2011 public override bool IsLocalName(string localName)
2012 {
2013 if (localName == null)
2014 {
2016 }
2017 return _node.IsLocalName(localName);
2018 }
2019
2020 public override bool IsLocalName(XmlDictionaryString localName)
2021 {
2022 if (localName == null)
2023 {
2025 }
2026 return _node.IsLocalName(localName);
2027 }
2028
2029 public override bool IsNamespaceUri(string namespaceUri)
2030 {
2031 if (namespaceUri == null)
2032 {
2034 }
2035 return _node.IsNamespaceUri(namespaceUri);
2036 }
2037
2038 public override bool IsNamespaceUri(XmlDictionaryString namespaceUri)
2039 {
2040 if (namespaceUri == null)
2041 {
2043 }
2044 return _node.IsNamespaceUri(namespaceUri);
2045 }
2046
2047 public sealed override bool IsStartElement()
2048 {
2049 switch (_node.NodeType)
2050 {
2051 case XmlNodeType.Element:
2052 return true;
2053 case XmlNodeType.EndElement:
2054 return false;
2055 case XmlNodeType.None:
2056 Read();
2057 if (_node.NodeType == XmlNodeType.Element)
2058 {
2059 return true;
2060 }
2061 break;
2062 }
2063 return MoveToContent() == XmlNodeType.Element;
2064 }
2065
2066 public override bool IsStartElement(string name)
2067 {
2068 if (name == null)
2069 {
2070 return false;
2071 }
2072 int num = name.IndexOf(':');
2073 string text;
2074 string text2;
2075 if (num == -1)
2076 {
2077 text = string.Empty;
2078 text2 = name;
2079 }
2080 else
2081 {
2082 text = name.Substring(0, num);
2083 text2 = name.Substring(num + 1);
2084 }
2085 if ((_node.NodeType == XmlNodeType.Element || IsStartElement()) && _node.Prefix == text)
2086 {
2087 return _node.LocalName == text2;
2088 }
2089 return false;
2090 }
2091
2092 public override bool IsStartElement(string localName, string namespaceUri)
2093 {
2094 if (localName == null)
2095 {
2096 return false;
2097 }
2098 if (namespaceUri == null)
2099 {
2100 return false;
2101 }
2102 if ((_node.NodeType == XmlNodeType.Element || IsStartElement()) && _node.LocalName == localName)
2103 {
2104 return _node.IsNamespaceUri(namespaceUri);
2105 }
2106 return false;
2107 }
2108
2109 public override bool IsStartElement(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
2110 {
2111 if (localName == null)
2112 {
2114 }
2115 if (namespaceUri == null)
2116 {
2118 }
2119 if ((_node.NodeType == XmlNodeType.Element || IsStartElement()) && _node.LocalName == localName)
2120 {
2121 return _node.IsNamespaceUri(namespaceUri);
2122 }
2123 return false;
2124 }
2125
2126 public override int IndexOfLocalName(string[] localNames, string namespaceUri)
2127 {
2128 if (localNames == null)
2129 {
2131 }
2132 if (namespaceUri == null)
2133 {
2135 }
2137 if (_node.IsNamespaceUri(namespaceUri))
2138 {
2139 if (qNameType == QNameType.Normal)
2140 {
2141 StringHandle localName = _node.LocalName;
2142 for (int i = 0; i < localNames.Length; i++)
2143 {
2144 string text = localNames[i];
2145 if (text == null)
2146 {
2148 }
2149 if (localName == text)
2150 {
2151 return i;
2152 }
2153 }
2154 }
2155 else
2156 {
2158 for (int j = 0; j < localNames.Length; j++)
2159 {
2160 string text2 = localNames[j];
2161 if (text2 == null)
2162 {
2164 }
2165 if (prefix == text2)
2166 {
2167 return j;
2168 }
2169 }
2170 }
2171 }
2172 return -1;
2173 }
2174
2176 {
2177 if (localNames == null)
2178 {
2180 }
2181 if (namespaceUri == null)
2182 {
2184 }
2186 if (_node.IsNamespaceUri(namespaceUri))
2187 {
2188 if (qNameType == QNameType.Normal)
2189 {
2190 StringHandle localName = _node.LocalName;
2191 for (int i = 0; i < localNames.Length; i++)
2192 {
2194 if (xmlDictionaryString == null)
2195 {
2197 }
2198 if (localName == xmlDictionaryString)
2199 {
2200 return i;
2201 }
2202 }
2203 }
2204 else
2205 {
2207 for (int j = 0; j < localNames.Length; j++)
2208 {
2210 if (xmlDictionaryString2 == null)
2211 {
2213 }
2215 {
2216 return j;
2217 }
2218 }
2219 }
2220 }
2221 return -1;
2222 }
2223
2224 public override int ReadValueChunk(char[] chars, int offset, int count)
2225 {
2226 if (chars == null)
2227 {
2229 }
2230 if (offset < 0)
2231 {
2233 }
2234 if (offset > chars.Length)
2235 {
2237 }
2238 if (count < 0)
2239 {
2241 }
2242 if (count > chars.Length - offset)
2243 {
2245 }
2247 {
2248 return actual;
2249 }
2250 string value = Value;
2251 actual = Math.Min(count, value.Length);
2252 value.CopyTo(0, chars, offset, actual);
2253 _value = value.Substring(actual);
2254 return actual;
2255 }
2256
2257 public override int ReadValueAsBase64(byte[] buffer, int offset, int count)
2258 {
2259 if (buffer == null)
2260 {
2262 }
2263 if (offset < 0)
2264 {
2266 }
2267 if (offset > buffer.Length)
2268 {
2270 }
2271 if (count < 0)
2272 {
2274 }
2275 if (count > buffer.Length - offset)
2276 {
2278 }
2279 if (count == 0)
2280 {
2281 return 0;
2282 }
2284 {
2285 return actual;
2286 }
2287 return ReadBytes(Base64Encoding, 3, 4, buffer, offset, Math.Min(count, 512), readContent: false);
2288 }
2289
2290 public override string ReadElementContentAsString()
2291 {
2292 if (_node.NodeType != XmlNodeType.Element)
2293 {
2295 }
2297 {
2298 Read();
2299 return string.Empty;
2300 }
2301 Read();
2302 string result = ReadContentAsString();
2304 return result;
2305 }
2306
2307 public override void ReadStartElement()
2308 {
2309 if (_node.NodeType != XmlNodeType.Element)
2310 {
2312 }
2313 Read();
2314 }
2315
2316 public override void ReadStartElement(string name)
2317 {
2318 MoveToStartElement(name);
2319 Read();
2320 }
2321
2322 public override void ReadStartElement(string localName, string namespaceUri)
2323 {
2324 MoveToStartElement(localName, namespaceUri);
2325 Read();
2326 }
2327
2328 public override void ReadEndElement()
2329 {
2330 if (_node.NodeType != XmlNodeType.EndElement && MoveToContent() != XmlNodeType.EndElement)
2331 {
2332 int num = ((_node.NodeType == XmlNodeType.Element) ? (_depth - 1) : _depth);
2333 if (num == 0)
2334 {
2336 }
2338 XmlExceptionHelper.ThrowEndElementExpected(this, xmlElementNode.LocalName.GetString(), xmlElementNode.Namespace.Uri.GetString());
2339 }
2340 Read();
2341 }
2342
2343 public override bool ReadAttributeValue()
2344 {
2346 if (attributeText == null)
2347 {
2348 return false;
2349 }
2351 return true;
2352 }
2353
2354 private void SkipValue(XmlNode node)
2355 {
2356 if (node.SkipValue)
2357 {
2358 Read();
2359 }
2360 }
2361
2362 public override bool TryGetBase64ContentLength(out int length)
2363 {
2364 if (_trailByteCount == 0 && _trailCharCount == 0 && _value == null)
2365 {
2366 XmlNode node = Node;
2367 if (node.IsAtomicValue)
2368 {
2370 }
2371 }
2372 return base.TryGetBase64ContentLength(out length);
2373 }
2374
2375 public override byte[] ReadContentAsBase64()
2376 {
2377 if (_trailByteCount == 0 && _trailCharCount == 0 && _value == null)
2378 {
2379 XmlNode node = Node;
2380 if (node.IsAtomicValue)
2381 {
2382 byte[] array = node.Value.ToByteArray();
2383 if (array.Length > _quotas.MaxArrayLength)
2384 {
2386 }
2387 SkipValue(node);
2388 return array;
2389 }
2390 }
2392 {
2394 }
2396 }
2397
2398 public override int ReadElementContentAsBase64(byte[] buffer, int offset, int count)
2399 {
2400 if (!_readingElement)
2401 {
2402 if (IsEmptyElement)
2403 {
2404 Read();
2405 return 0;
2406 }
2408 _readingElement = true;
2409 }
2411 if (num == 0)
2412 {
2414 _readingElement = false;
2415 }
2416 return num;
2417 }
2418
2419 public override int ReadContentAsBase64(byte[] buffer, int offset, int count)
2420 {
2421 if (buffer == null)
2422 {
2424 }
2425 if (offset < 0)
2426 {
2428 }
2429 if (offset > buffer.Length)
2430 {
2432 }
2433 if (count < 0)
2434 {
2436 }
2437 if (count > buffer.Length - offset)
2438 {
2440 }
2441 if (count == 0)
2442 {
2443 return 0;
2444 }
2445 if (_trailByteCount == 0 && _trailCharCount == 0 && _value == null && _node.QNameType == QNameType.Normal)
2446 {
2447 int actual;
2449 {
2450 if (actual != 0)
2451 {
2452 return actual;
2453 }
2454 Read();
2455 }
2456 }
2457 XmlNodeType nodeType = _node.NodeType;
2458 if (nodeType == XmlNodeType.Element || nodeType == XmlNodeType.EndElement)
2459 {
2460 return 0;
2461 }
2462 return ReadBytes(Base64Encoding, 3, 4, buffer, offset, Math.Min(count, 512), readContent: true);
2463 }
2464
2465 public override byte[] ReadContentAsBinHex()
2466 {
2468 }
2469
2470 public override int ReadContentAsBinHex(byte[] buffer, int offset, int count)
2471 {
2472 if (buffer == null)
2473 {
2475 }
2476 if (offset < 0)
2477 {
2479 }
2480 if (offset > buffer.Length)
2481 {
2483 }
2484 if (count < 0)
2485 {
2487 }
2488 if (count > buffer.Length - offset)
2489 {
2491 }
2492 if (count == 0)
2493 {
2494 return 0;
2495 }
2496 return ReadBytes(BinHexEncoding, 1, 2, buffer, offset, Math.Min(count, 512), readContent: true);
2497 }
2498
2499 public override int ReadElementContentAsBinHex(byte[] buffer, int offset, int count)
2500 {
2501 if (!_readingElement)
2502 {
2503 if (IsEmptyElement)
2504 {
2505 Read();
2506 return 0;
2507 }
2509 _readingElement = true;
2510 }
2512 if (num == 0)
2513 {
2515 _readingElement = false;
2516 }
2517 return num;
2518 }
2519
2520 private int ReadBytes(Encoding encoding, int byteBlock, int charBlock, byte[] buffer, int offset, int byteCount, bool readContent)
2521 {
2522 if (_trailByteCount > 0)
2523 {
2524 int num = Math.Min(_trailByteCount, byteCount);
2526 _trailByteCount -= num;
2528 return num;
2529 }
2530 XmlNodeType nodeType = _node.NodeType;
2531 if (nodeType == XmlNodeType.Element || nodeType == XmlNodeType.EndElement)
2532 {
2533 return 0;
2534 }
2536 char[] charBuffer = GetCharBuffer(num2);
2537 int num3 = 0;
2538 while (true)
2539 {
2540 if (_trailCharCount > 0)
2541 {
2544 _trailCharCount = 0;
2545 }
2546 while (num3 < charBlock)
2547 {
2548 int num4;
2549 if (readContent)
2550 {
2552 if (num4 == 1 && charBuffer[num3] == '\n')
2553 {
2554 continue;
2555 }
2556 }
2557 else
2558 {
2560 }
2561 if (num4 == 0)
2562 {
2563 break;
2564 }
2565 num3 += num4;
2566 }
2567 if (num3 >= charBlock)
2568 {
2570 if (_trailCharCount > 0)
2571 {
2572 if (_trailChars == null)
2573 {
2574 _trailChars = new char[4];
2575 }
2578 }
2579 }
2580 try
2581 {
2582 if (byteCount < byteBlock)
2583 {
2584 if (_trailBytes == null)
2585 {
2586 _trailBytes = new byte[3];
2587 }
2593 return num5;
2594 }
2595 return encoding.GetBytes(charBuffer, 0, num3, buffer, offset);
2596 }
2597 catch (FormatException ex)
2598 {
2599 int num6 = 0;
2600 int num7 = 0;
2601 while (true)
2602 {
2604 {
2605 num7++;
2606 continue;
2607 }
2608 if (num7 == num3)
2609 {
2610 break;
2611 }
2613 }
2614 if (num6 == num3)
2615 {
2616 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(ex.Message, ex.InnerException));
2617 }
2618 num3 = num6;
2619 }
2620 }
2621 }
2622
2623 public override string ReadContentAsString()
2624 {
2625 XmlNode node = Node;
2626 if (node.IsAtomicValue)
2627 {
2628 string text;
2629 if (_value != null)
2630 {
2631 text = _value;
2632 if (node.AttributeText == null)
2633 {
2634 _value = string.Empty;
2635 }
2636 }
2637 else
2638 {
2639 text = node.Value.GetString();
2640 SkipValue(node);
2641 if (text.Length > _quotas.MaxStringContentLength)
2642 {
2644 }
2645 }
2646 return text;
2647 }
2649 }
2650
2651 public override bool ReadContentAsBoolean()
2652 {
2653 XmlNode node = Node;
2654 if (_value == null && node.IsAtomicValue)
2655 {
2656 bool result = node.Value.ToBoolean();
2657 SkipValue(node);
2658 return result;
2659 }
2661 }
2662
2663 public override long ReadContentAsLong()
2664 {
2665 XmlNode node = Node;
2666 if (_value == null && node.IsAtomicValue)
2667 {
2668 long result = node.Value.ToLong();
2669 SkipValue(node);
2670 return result;
2671 }
2673 }
2674
2675 public override int ReadContentAsInt()
2676 {
2677 XmlNode node = Node;
2678 if (_value == null && node.IsAtomicValue)
2679 {
2680 int result = node.Value.ToInt();
2681 SkipValue(node);
2682 return result;
2683 }
2685 }
2686
2688 {
2689 XmlNode node = Node;
2690 if (_value == null && node.IsAtomicValue)
2691 {
2692 DateTime result = node.Value.ToDateTime();
2693 SkipValue(node);
2694 return result;
2695 }
2697 }
2698
2699 public override double ReadContentAsDouble()
2700 {
2701 XmlNode node = Node;
2702 if (_value == null && node.IsAtomicValue)
2703 {
2704 double result = node.Value.ToDouble();
2705 SkipValue(node);
2706 return result;
2707 }
2709 }
2710
2711 public override float ReadContentAsFloat()
2712 {
2713 XmlNode node = Node;
2714 if (_value == null && node.IsAtomicValue)
2715 {
2716 float result = node.Value.ToSingle();
2717 SkipValue(node);
2718 return result;
2719 }
2721 }
2722
2723 public override decimal ReadContentAsDecimal()
2724 {
2725 XmlNode node = Node;
2726 if (_value == null && node.IsAtomicValue)
2727 {
2728 decimal result = node.Value.ToDecimal();
2729 SkipValue(node);
2730 return result;
2731 }
2733 }
2734
2736 {
2737 XmlNode node = Node;
2738 if (_value == null && node.IsAtomicValue)
2739 {
2740 UniqueId result = node.Value.ToUniqueId();
2741 SkipValue(node);
2742 return result;
2743 }
2745 }
2746
2748 {
2749 XmlNode node = Node;
2750 if (_value == null && node.IsAtomicValue)
2751 {
2752 TimeSpan result = node.Value.ToTimeSpan();
2753 SkipValue(node);
2754 return result;
2755 }
2757 }
2758
2759 public override Guid ReadContentAsGuid()
2760 {
2761 XmlNode node = Node;
2762 if (_value == null && node.IsAtomicValue)
2763 {
2764 Guid result = node.Value.ToGuid();
2765 SkipValue(node);
2766 return result;
2767 }
2769 }
2770
2771 public override object ReadContentAsObject()
2772 {
2773 XmlNode node = Node;
2774 if (_value == null && node.IsAtomicValue)
2775 {
2776 object result = node.Value.ToObject();
2777 SkipValue(node);
2778 return result;
2779 }
2780 return ReadContentAsString();
2781 }
2782
2784 {
2785 if (type == typeof(ulong))
2786 {
2787 if (_value == null && _node.IsAtomicValue)
2788 {
2789 ulong num = _node.Value.ToULong();
2791 return num;
2792 }
2794 }
2795 if (type == typeof(bool))
2796 {
2797 return ReadContentAsBoolean();
2798 }
2799 if (type == typeof(int))
2800 {
2801 return ReadContentAsInt();
2802 }
2803 if (type == typeof(long))
2804 {
2805 return ReadContentAsLong();
2806 }
2807 if (type == typeof(float))
2808 {
2809 return ReadContentAsFloat();
2810 }
2811 if (type == typeof(double))
2812 {
2813 return ReadContentAsDouble();
2814 }
2815 if (type == typeof(decimal))
2816 {
2817 return ReadContentAsDecimal();
2818 }
2819 if (type == typeof(DateTime))
2820 {
2821 return ReadContentAsDateTime();
2822 }
2823 if (type == typeof(UniqueId))
2824 {
2825 return ReadContentAsUniqueId();
2826 }
2827 if (type == typeof(Guid))
2828 {
2829 return ReadContentAsGuid();
2830 }
2831 if (type == typeof(TimeSpan))
2832 {
2833 return ReadContentAsTimeSpan();
2834 }
2835 if (type == typeof(object))
2836 {
2837 return ReadContentAsObject();
2838 }
2839 return base.ReadContentAs(type, namespaceResolver);
2840 }
2841
2846
2847 public override void Skip()
2848 {
2849 if (_node.ReadState != ReadState.Interactive)
2850 {
2851 return;
2852 }
2853 if ((_node.NodeType == XmlNodeType.Element || MoveToElement()) && !IsEmptyElement)
2854 {
2855 int depth = Depth;
2856 while (Read() && depth < Depth)
2857 {
2858 }
2859 if (_node.NodeType == XmlNodeType.EndElement)
2860 {
2861 Read();
2862 }
2863 }
2864 else
2865 {
2866 Read();
2867 }
2868 }
2869
2871 {
2873 }
2874
2876 {
2878 }
2879
2884
2885 public override short[] ReadInt16Array(string localName, string namespaceUri)
2886 {
2887 return Int16ArrayHelperWithString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2888 }
2889
2890 public override short[] ReadInt16Array(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
2891 {
2892 return Int16ArrayHelperWithDictionaryString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2893 }
2894
2895 public override int[] ReadInt32Array(string localName, string namespaceUri)
2896 {
2897 return Int32ArrayHelperWithString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2898 }
2899
2900 public override int[] ReadInt32Array(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
2901 {
2902 return Int32ArrayHelperWithDictionaryString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2903 }
2904
2905 public override long[] ReadInt64Array(string localName, string namespaceUri)
2906 {
2907 return Int64ArrayHelperWithString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2908 }
2909
2910 public override long[] ReadInt64Array(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
2911 {
2912 return Int64ArrayHelperWithDictionaryString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2913 }
2914
2915 public override float[] ReadSingleArray(string localName, string namespaceUri)
2916 {
2917 return SingleArrayHelperWithString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2918 }
2919
2920 public override float[] ReadSingleArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
2921 {
2922 return SingleArrayHelperWithDictionaryString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2923 }
2924
2925 public override double[] ReadDoubleArray(string localName, string namespaceUri)
2926 {
2927 return DoubleArrayHelperWithString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2928 }
2929
2930 public override double[] ReadDoubleArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
2931 {
2932 return DoubleArrayHelperWithDictionaryString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2933 }
2934
2935 public override decimal[] ReadDecimalArray(string localName, string namespaceUri)
2936 {
2937 return DecimalArrayHelperWithString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2938 }
2939
2940 public override decimal[] ReadDecimalArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
2941 {
2942 return DecimalArrayHelperWithDictionaryString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2943 }
2944
2945 public override DateTime[] ReadDateTimeArray(string localName, string namespaceUri)
2946 {
2947 return DateTimeArrayHelperWithString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2948 }
2949
2950 public override DateTime[] ReadDateTimeArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
2951 {
2952 return DateTimeArrayHelperWithDictionaryString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2953 }
2954
2955 public override Guid[] ReadGuidArray(string localName, string namespaceUri)
2956 {
2957 return GuidArrayHelperWithString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2958 }
2959
2960 public override Guid[] ReadGuidArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
2961 {
2962 return GuidArrayHelperWithDictionaryString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2963 }
2964
2965 public override TimeSpan[] ReadTimeSpanArray(string localName, string namespaceUri)
2966 {
2967 return TimeSpanArrayHelperWithString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2968 }
2969
2970 public override TimeSpan[] ReadTimeSpanArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
2971 {
2972 return TimeSpanArrayHelperWithDictionaryString.Instance.ReadArray(this, localName, namespaceUri, _quotas.MaxArrayLength);
2973 }
2974
2975 public string GetOpenElements()
2976 {
2977 string text = string.Empty;
2978 for (int num = _depth; num > 0; num--)
2979 {
2980 string @string = _elementNodes[num].LocalName.GetString();
2981 if (num != _depth)
2982 {
2983 text += ", ";
2984 }
2985 text += @string;
2986 }
2987 return text;
2988 }
2989
2990 private char[] GetCharBuffer(int count)
2991 {
2992 if (count > 1024)
2993 {
2994 return new char[count];
2995 }
2996 if (_chars == null || _chars.Length < count)
2997 {
2998 _chars = new char[count];
2999 }
3000 return _chars;
3001 }
3002
3004 {
3005 int offset;
3006 int length;
3007 byte[] @string = _node.Prefix.GetString(out offset, out length);
3008 int offset2;
3009 int length2;
3011 writer.WriteStartElement(@string, offset, length, string2, offset2, length2);
3012 }
3013
3015 {
3016 if (attributeNode.QNameType == QNameType.Normal)
3017 {
3018 int offset;
3019 int length;
3020 byte[] @string = attributeNode.Prefix.GetString(out offset, out length);
3021 int offset2;
3022 int length2;
3023 byte[] string2 = attributeNode.LocalName.GetString(out offset2, out length2);
3024 writer.WriteStartAttribute(@string, offset, length, string2, offset2, length2);
3025 attributeNode.Value.Sign(writer);
3026 writer.WriteEndAttribute();
3027 }
3028 else
3029 {
3030 int offset3;
3031 int length3;
3032 byte[] string3 = attributeNode.Namespace.Prefix.GetString(out offset3, out length3);
3033 int offset4;
3034 int length4;
3035 byte[] string4 = attributeNode.Namespace.Uri.GetString(out offset4, out length4);
3036 writer.WriteXmlnsAttribute(string3, offset3, length3, string4, offset4, length4);
3037 }
3038 }
3039
3041 {
3042 int offset;
3043 int length;
3044 byte[] @string = _node.Prefix.GetString(out offset, out length);
3045 int offset2;
3046 int length2;
3048 writer.WriteEndElement(@string, offset, length, string2, offset2, length2);
3049 }
3050
3052 {
3053 switch (_node.NodeType)
3054 {
3055 case XmlNodeType.Element:
3056 {
3058 for (int i = 0; i < _attributeCount; i++)
3059 {
3061 }
3062 writer.WriteEndStartElement(_node.IsEmptyElement);
3063 break;
3064 }
3065 case XmlNodeType.Text:
3066 case XmlNodeType.CDATA:
3067 case XmlNodeType.Whitespace:
3068 case XmlNodeType.SignificantWhitespace:
3070 break;
3071 case XmlNodeType.XmlDeclaration:
3072 writer.WriteDeclaration();
3073 break;
3074 case XmlNodeType.Comment:
3075 writer.WriteComment(_node.Value.GetString());
3076 break;
3077 case XmlNodeType.EndElement:
3079 break;
3080 default:
3082 case XmlNodeType.None:
3083 break;
3084 }
3085 }
3086
3087 protected void SignNode()
3088 {
3089 if (_signing)
3090 {
3092 }
3093 }
3094
3109
3120
3122}
static void Sort(Array array)
Definition Array.cs:2329
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
static void BlockCopy(Array src, int srcOffset, Array dst, int dstOffset, int count)
Definition Buffer.cs:102
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static string XmlMalformedDecl
Definition SR.cs:458
static string XmlElementAttributes
Definition SR.cs:308
static string XmlInvalidVersion
Definition SR.cs:448
static string XmlDeclMissingVersion
Definition SR.cs:364
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlInvalidOperation
Definition SR.cs:434
static string XmlCanonicalizationStarted
Definition SR.cs:698
static string XmlCanonicalizationNotStarted
Definition SR.cs:700
static string ValueMustBeNonNegative
Definition SR.cs:296
static string XmlSpecificBindingPrefix
Definition SR.cs:496
static string XmlInvalidEncoding_UTF8
Definition SR.cs:426
static string XmlInvalidStandalone
Definition SR.cs:442
static string SizeExceedsRemainingBufferSpace
Definition SR.cs:324
static string XmlEndElementNoOpenNodes
Definition SR.cs:386
static string OffsetExceedsBufferSize
Definition SR.cs:322
Definition SR.cs:7
virtual byte[] GetBytes(char[] chars)
Definition Encoding.cs:781
static readonly DateTimeArrayHelperWithDictionaryString Instance
static readonly DateTimeArrayHelperWithString Instance
static readonly DecimalArrayHelperWithDictionaryString Instance
static readonly DecimalArrayHelperWithString Instance
static readonly DoubleArrayHelperWithDictionaryString Instance
static readonly DoubleArrayHelperWithString Instance
static readonly GuidArrayHelperWithDictionaryString Instance
static readonly GuidArrayHelperWithString Instance
static readonly Int16ArrayHelperWithDictionaryString Instance
static readonly Int16ArrayHelperWithString Instance
static readonly Int32ArrayHelperWithDictionaryString Instance
static readonly Int32ArrayHelperWithString Instance
static readonly Int64ArrayHelperWithDictionaryString Instance
static readonly Int64ArrayHelperWithString Instance
static string GetString(PrefixHandleType type)
void SetValue(PrefixHandleType type)
static PrefixHandleType GetAlphaPrefix(int index)
bool TryGetShortPrefix(out PrefixHandleType type)
static readonly SingleArrayHelperWithDictionaryString Instance
static readonly SingleArrayHelperWithString Instance
bool TryGetDictionaryString([NotNullWhen(true)] out XmlDictionaryString value)
string GetString(XmlNameTable nameTable)
static readonly TimeSpanArrayHelperWithDictionaryString Instance
static readonly TimeSpanArrayHelperWithString Instance
void Sign(XmlSigningNodeWriter writer)
bool TryReadChars(char[] chars, int offset, int count, out int actual)
bool TryGetByteArrayLength(out int length)
bool TryReadBase64(byte[] buffer, int offset, int count, out int actual)
bool TryGetDictionaryString([NotNullWhen(true)] out XmlDictionaryString value)
int CompareQNameType(QNameType type1, QNameType type2)
int Compare(object obj1, object obj2)
bool Sort(XmlAttributeNode[] attributeNodes, int attributeCount)
void GetIndeces(out int attributeIndex1, out int attributeIndex2)
bool TryGetShortPrefix(string s, out PrefixHandleType shortPrefix)
static readonly Namespace s_emptyNamespace
NamespaceManager(XmlBufferReader bufferReader)
void Sign(XmlSigningNodeWriter writer)
Namespace LookupNamespace(PrefixHandleType prefix)
Namespace LookupNamespace(PrefixHandle prefix)
Namespace(XmlBufferReader bufferReader)
bool IsUri(XmlDictionaryString s)
XmlAtomicTextNode(XmlBufferReader bufferReader)
XmlAttributeNode(PrefixHandle prefix, StringHandle localName, ValueHandle value)
XmlAttributeNode(XmlBufferReader bufferReader)
XmlAttributeTextNode(PrefixHandle prefix, StringHandle localName, ValueHandle value)
XmlCDataNode(XmlBufferReader bufferReader)
XmlClosedNode(XmlBufferReader bufferReader)
XmlCommentNode(XmlBufferReader bufferReader)
XmlComplexTextNode(XmlBufferReader bufferReader)
XmlDeclarationNode(XmlBufferReader bufferReader)
XmlElementNode(PrefixHandle prefix, StringHandle localName, ValueHandle value)
readonly XmlEndElementNode _endElementNode
XmlElementNode(XmlBufferReader bufferReader)
XmlEndElementNode(PrefixHandle prefix, StringHandle localName, ValueHandle value)
XmlEndOfFileNode(XmlBufferReader bufferReader)
XmlInitialNode(XmlBufferReader bufferReader)
readonly PrefixHandle _prefix
bool IsLocalName(string localName)
readonly StringHandle _localName
bool IsLocalName(XmlDictionaryString localName)
readonly XmlAttributeTextNode _attributeTextNode
XmlAttributeTextNode AttributeText
bool TryGetValueAsDictionaryString([NotNullWhen(true)] out XmlDictionaryString value)
bool IsLocalNameAndNamespaceUri(string localName, string ns)
bool TryGetNamespaceUriAsDictionaryString([NotNullWhen(true)] out XmlDictionaryString ns)
XmlNode(XmlNodeType nodeType, PrefixHandle prefix, StringHandle localName, ValueHandle value, XmlNodeFlags nodeFlags, ReadState readState, XmlAttributeTextNode attributeTextNode, int depthDelta)
bool IsNamespaceUri(XmlDictionaryString ns)
bool TryGetLocalNameAsDictionaryString([NotNullWhen(true)] out XmlDictionaryString localName)
bool IsLocalNameAndNamespaceUri(XmlDictionaryString localName, XmlDictionaryString ns)
bool IsPrefixAndLocalName(string prefix, string localName)
XmlTextNode(XmlNodeType nodeType, PrefixHandle prefix, StringHandle localName, ValueHandle value, XmlNodeFlags nodeFlags, ReadState readState, XmlAttributeTextNode attributeTextNode, int depthDelta)
XmlWhitespaceTextNode(XmlBufferReader bufferReader)
void MoveToInitial(XmlDictionaryReaderQuotas quotas)
override int IndexOfLocalName(string[] localNames, string namespaceUri)
override bool MoveToFirstAttribute()
XmlComplexTextNode _complexTextNode
override XmlNameTable NameTable
static Base64Encoding s_base64Encoding
void SignEndElement(XmlSigningNodeWriter writer)
override void ReadStartElement(string name)
override int ReadElementContentAsBase64(byte[] buffer, int offset, int count)
override object ReadContentAs(Type type, IXmlNamespaceResolver namespaceResolver)
override decimal[] ReadDecimalArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
override UniqueId ReadContentAsUniqueId()
override TimeSpan ReadContentAsTimeSpan()
XmlSigningNodeWriter CreateSigningNodeWriter()
override bool CanReadBinaryContent
override string GetAttribute(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
XmlDeclarationNode MoveToDeclaration()
override double ReadContentAsDouble()
void CheckAttributes(XmlAttributeNode[] attributeNodes, int attributeCount)
override string LookupNamespace(string prefix)
override bool MoveToAttribute(string name)
override bool CanReadValueChunk
XmlTextNode MoveToWhitespaceText()
override void StartCanonicalization(Stream stream, bool includeComments, string[] inclusivePrefixes)
override string ReadElementContentAsString()
void SignStartElement(XmlSigningNodeWriter writer)
override bool TryGetLocalNameAsDictionaryString([NotNullWhen(true)] out XmlDictionaryString localName)
AttributeSorter _attributeSorter
override bool IsLocalName(string localName)
override byte[] ReadContentAsBinHex()
override long ReadContentAsLong()
override bool MoveToAttribute(string localName, string namespaceUri)
override decimal ReadContentAsDecimal()
readonly XmlDictionaryReaderQuotas _quotas
override byte[] ReadContentAsBase64()
override bool ReadAttributeValue()
override bool MoveToElement()
XmlComplexTextNode MoveToComplexText()
override Guid[] ReadGuidArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
Namespace LookupNamespace(PrefixHandle prefix)
static Base64Encoding Base64Encoding
override bool IsStartElement(string localName, string namespaceUri)
override string GetAttribute(string name)
override void ReadStartElement()
override bool IsStartElement(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
override int ReadContentAsBase64(byte[] buffer, int offset, int count)
XmlCommentNode MoveToComment()
override int ReadElementContentAsBinHex(byte[] buffer, int offset, int count)
XmlAttributeNode[] _attributeNodes
override bool IsNamespaceUri(string namespaceUri)
override bool TryGetValueAsDictionaryString([NotNullWhen(true)] out XmlDictionaryString value)
override double[] ReadDoubleArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
override short[] ReadInt16Array(string localName, string namespaceUri)
readonly XmlBufferReader _bufferReader
override void MoveToAttribute(int index)
override TimeSpan[] ReadTimeSpanArray(string localName, string namespaceUri)
static readonly XmlEndOfFileNode s_endOfFileNode
override void ReadEndElement()
override int ReadContentAsInt()
override short[] ReadInt16Array(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
override bool IsStartElement(string name)
override int IndexOfLocalName(XmlDictionaryString[] localNames, XmlDictionaryString namespaceUri)
readonly XmlElementNode _rootElementNode
void MoveToNode(XmlNode node)
XmlSigningNodeWriter _signingWriter
override Guid[] ReadGuidArray(string localName, string namespaceUri)
XmlAttributeNode GetAttributeNode(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
override float[] ReadSingleArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
XmlAttributeNode GetAttributeNode(int index)
override string ReadContentAsString()
override int ReadContentAsBinHex(byte[] buffer, int offset, int count)
override XmlNodeType MoveToContent()
override DateTime[] ReadDateTimeArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
XmlDeclarationNode _declarationNode
XmlAttributeNode AddXmlAttribute()
override void ReadStartElement(string localName, string namespaceUri)
XmlAttributeNode AddAttribute(QNameType qnameType, bool isAtomicValue)
override bool TryGetBase64ContentLength(out int length)
Namespace LookupNamespace(PrefixHandleType prefix)
override Guid ReadContentAsGuid()
void SkipValue(XmlNode node)
override DateTime ReadContentAsDateTime()
char[] GetCharBuffer(int count)
XmlAtomicTextNode MoveToAtomicText()
override int ReadValueAsBase64(byte[] buffer, int offset, int count)
static readonly XmlInitialNode s_initialNode
static BinHexEncoding s_binHexEncoding
readonly NamespaceManager _nsMgr
override bool TryGetNamespaceUriAsDictionaryString([NotNullWhen(true)] out XmlDictionaryString localName)
void FixXmlAttribute(XmlAttributeNode attributeNode)
override long[] ReadInt64Array(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
override bool MoveToNextAttribute()
override XmlDictionaryReaderQuotas Quotas
override void EndCanonicalization()
override void ResolveEntity()
override float ReadContentAsFloat()
void SignAttribute(XmlSigningNodeWriter writer, XmlAttributeNode attributeNode)
XmlAttributeNode GetAttributeNode(string localName, string namespaceUri)
XmlElementNode[] _elementNodes
XmlAttributeNode AddXmlnsAttribute(Namespace ns)
override string NamespaceURI
bool CheckStandalone(int attr)
XmlBufferReader BufferReader
override float[] ReadSingleArray(string localName, string namespaceUri)
override decimal[] ReadDecimalArray(string localName, string namespaceUri)
XmlAttributeNode AddAttribute()
override object ReadContentAsObject()
override string GetAttribute(int index)
static readonly XmlClosedNode s_closedNode
XmlWhitespaceTextNode _whitespaceTextNode
override int ReadValueChunk(char[] chars, int offset, int count)
override long[] ReadInt64Array(string localName, string namespaceUri)
override bool IsStartElement()
override bool IsLocalName(XmlDictionaryString localName)
override int[] ReadInt32Array(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
static BinHexEncoding BinHexEncoding
override DateTime[] ReadDateTimeArray(string localName, string namespaceUri)
void ProcessAttributes(XmlAttributeNode[] attributeNodes, int attributeCount)
override int[] ReadInt32Array(string localName, string namespaceUri)
override bool ReadContentAsBoolean()
override XmlNodeType NodeType
override TimeSpan[] ReadTimeSpanArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
int ReadBytes(Encoding encoding, int byteBlock, int charBlock, byte[] buffer, int offset, int byteCount, bool readContent)
override string GetAttribute(string localName, string namespaceUri)
override bool IsNamespaceUri(XmlDictionaryString namespaceUri)
XmlAttributeNode GetAttributeNode(string name)
readonly XmlAtomicTextNode _atomicTextNode
bool CheckDeclAttribute(int index, string localName, string value, bool checkLower, string valueSR)
void SignNode(XmlSigningNodeWriter writer)
XmlElementNode EnterScope()
override double[] ReadDoubleArray(string localName, string namespaceUri)
static XmlBufferReader Empty
static float ToSingle(string value)
static bool ToBoolean(string value)
static bool IsWhitespace(string s)
static decimal ToDecimal(string value)
static int ToInt32(string value)
static long ToInt64(string value)
static Guid ToGuid(string value)
static TimeSpan ToTimeSpan(string value)
static ulong ToUInt64(string value)
static double ToDouble(string value)
static DateTime ToDateTime(long value)
static UniqueId ToUniqueId(string value)
virtual int ReadContentAsChars(char[] chars, int offset, int count)
static XmlDictionaryString Empty
static void ThrowMaxStringContentLengthExceeded(XmlDictionaryReader reader, int maxStringContentLength)
static void ThrowEndElementExpected(XmlDictionaryReader reader, string localName, string ns)
static void ThrowEmptyNamespace(XmlDictionaryReader reader)
static void ThrowMaxDepthExceeded(XmlDictionaryReader reader, int maxDepth)
static void ThrowUndefinedPrefix(XmlDictionaryReader reader, string prefix)
static void ThrowUnexpectedEndOfFile(XmlDictionaryReader reader)
static void ThrowInvalidBinaryFormat(XmlDictionaryReader reader)
static void ThrowMultipleRootElements(XmlDictionaryReader reader)
static void ThrowDuplicateAttribute(XmlDictionaryReader reader, string prefix1, string prefix2, string localName, string ns)
static void ThrowDuplicateXmlnsAttribute(XmlDictionaryReader reader, string localName, string ns)
static void ThrowMaxArrayLengthExceeded(XmlDictionaryReader reader, int maxArrayLength)
static void ThrowUnexpectedEndElement(XmlDictionaryReader reader)
static void ThrowXmlException(XmlDictionaryReader reader, string res)
string Add(char[] array, int offset, int length)
static XmlNodeWriter Null
virtual ? XmlNamespaceManager NamespaceManager
Definition XmlReader.cs:126
void SetOutput(XmlNodeWriter writer, Stream stream, bool includeComments, string[] inclusivePrefixes)
DateTime IConvertible. ToDateTime(IFormatProvider provider)
Definition DateTime.cs:1355