Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlDictionaryReaderQuotas.cs
Go to the documentation of this file.
3
4namespace System.Xml;
5
6public sealed class XmlDictionaryReaderQuotas
7{
8 private bool _readOnly;
9
11
12 private int _maxArrayLength;
13
14 private int _maxDepth;
15
17
18 private int _maxBytesPerRead;
19
21
22 private const int DefaultMaxDepth = 32;
23
24 private const int DefaultMaxStringContentLength = 8192;
25
26 private const int DefaultMaxArrayLength = 16384;
27
28 private const int DefaultMaxBytesPerRead = 4096;
29
30 private const int DefaultMaxNameTableCharCount = 16384;
31
32 private static readonly XmlDictionaryReaderQuotas s_maxQuota = new XmlDictionaryReaderQuotas(int.MaxValue, int.MaxValue, int.MaxValue, int.MaxValue, int.MaxValue, XmlDictionaryReaderQuotaTypes.MaxDepth | XmlDictionaryReaderQuotaTypes.MaxStringContentLength | XmlDictionaryReaderQuotaTypes.MaxArrayLength | XmlDictionaryReaderQuotaTypes.MaxBytesPerRead | XmlDictionaryReaderQuotaTypes.MaxNameTableCharCount);
33
35
36 [DefaultValue(8192)]
38 {
39 get
40 {
42 }
43 set
44 {
45 if (_readOnly)
46 {
48 }
49 if (value <= 0)
50 {
52 }
54 _modifiedQuotas |= XmlDictionaryReaderQuotaTypes.MaxStringContentLength;
55 }
56 }
57
58 [DefaultValue(16384)]
59 public int MaxArrayLength
60 {
61 get
62 {
63 return _maxArrayLength;
64 }
65 set
66 {
67 if (_readOnly)
68 {
70 }
71 if (value <= 0)
72 {
74 }
77 }
78 }
79
80 [DefaultValue(4096)]
81 public int MaxBytesPerRead
82 {
83 get
84 {
85 return _maxBytesPerRead;
86 }
87 set
88 {
89 if (_readOnly)
90 {
92 }
93 if (value <= 0)
94 {
96 }
99 }
100 }
101
102 [DefaultValue(32)]
103 public int MaxDepth
104 {
105 get
106 {
107 return _maxDepth;
108 }
109 set
110 {
111 if (_readOnly)
112 {
114 }
115 if (value <= 0)
116 {
118 }
121 }
122 }
123
124 [DefaultValue(16384)]
126 {
127 get
128 {
130 }
131 set
132 {
133 if (_readOnly)
134 {
136 }
137 if (value <= 0)
138 {
140 }
142 _modifiedQuotas |= XmlDictionaryReaderQuotaTypes.MaxNameTableCharCount;
143 }
144 }
145
147
149 {
150 _maxDepth = 32;
152 _maxArrayLength = 16384;
153 _maxBytesPerRead = 4096;
155 }
156
167
180
190
191 internal void MakeReadOnly()
192 {
193 _readOnly = true;
194 }
195}
static string QuotaIsReadOnly
Definition SR.cs:264
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string QuotaMustBePositive
Definition SR.cs:262
static string QuotaCopyReadOnly
Definition SR.cs:266
Definition SR.cs:7
void InternalCopyTo(XmlDictionaryReaderQuotas quotas)
void CopyTo(XmlDictionaryReaderQuotas quotas)
static readonly XmlDictionaryReaderQuotas s_maxQuota
XmlDictionaryReaderQuotas(int maxDepth, int maxStringContentLength, int maxArrayLength, int maxBytesPerRead, int maxNameTableCharCount, XmlDictionaryReaderQuotaTypes modifiedQuotas)
XmlDictionaryReaderQuotaTypes _modifiedQuotas