Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
BaseProcessor.cs
Go to the documentation of this file.
1namespace System.Xml.Schema;
2
3internal class BaseProcessor
4{
5 private readonly XmlNameTable _nameTable;
6
8
9 private readonly ValidationEventHandler _eventHandler;
10
12
13 private int _errorCount;
14
15 private readonly string _nsXml;
16
18
20 {
21 get
22 {
23 if (_schemaNames == null)
24 {
26 }
27 return _schemaNames;
28 }
29 }
30
31 protected ValidationEventHandler EventHandler => _eventHandler;
32
34
35 protected bool HasErrors => _errorCount != 0;
36
41
50
52 {
53 if (qname.Name.Length == 0)
54 {
55 return;
56 }
57 XmlSchemaObject xmlSchemaObject = table[qname];
58 if (xmlSchemaObject != null)
59 {
60 if (xmlSchemaObject == item)
61 {
62 return;
63 }
66 {
67 string strA = _nameTable.Add(qname.Namespace);
68 if (Ref.Equal(strA, _nsXml))
69 {
71 XmlSchemaObject xmlSchemaObject2 = buildInSchema.AttributeGroups[qname];
73 {
74 table.Insert(qname, item);
75 return;
76 }
78 {
79 return;
80 }
81 }
83 {
84 return;
85 }
87 }
88 else if (item is XmlSchemaAttribute)
89 {
90 string strA2 = _nameTable.Add(qname.Namespace);
91 if (Ref.Equal(strA2, _nsXml))
92 {
96 {
97 table.Insert(qname, item);
98 return;
99 }
100 if (item == xmlSchemaObject3)
101 {
102 return;
103 }
104 }
106 }
107 else if (item is XmlSchemaSimpleType)
108 {
110 {
111 return;
112 }
114 }
116 {
118 {
119 return;
120 }
122 }
123 else if (item is XmlSchemaGroup)
124 {
126 {
127 return;
128 }
130 }
131 else if (item is XmlSchemaNotation)
132 {
134 }
136 {
138 }
140 }
141 else
142 {
143 table.Add(qname, item);
144 }
145 }
146
165
167 {
170 if (xmlSchemaGroup2 == xmlSchemaGroup.Redefined)
171 {
172 if (xmlSchemaGroup2.CanonicalParticle == null)
173 {
174 table.Insert(xmlSchemaGroup.QualifiedName, xmlSchemaGroup);
175 return true;
176 }
177 }
178 else if (xmlSchemaGroup2.Redefined == xmlSchemaGroup)
179 {
180 return true;
181 }
182 return false;
183 }
184
186 {
189 if (xmlSchemaType2 == xmlSchemaType.Redefined)
190 {
191 if (xmlSchemaType2.ElementDecl == null)
192 {
193 table.Insert(xmlSchemaType.QualifiedName, xmlSchemaType);
194 return true;
195 }
196 }
197 else if (xmlSchemaType2.Redefined == xmlSchemaType)
198 {
199 return true;
200 }
201 return false;
202 }
203
208
209 protected void SendValidationEvent(string code, string msg, XmlSchemaObject source)
210 {
212 }
213
214 protected void SendValidationEvent(string code, string msg1, string msg2, XmlSchemaObject source)
215 {
217 }
218
220 {
221 SendValidationEvent(new XmlSchemaException(code, args, innerException, source.SourceUri, source.LineNumber, source.LinePosition, source), XmlSeverityType.Error);
222 }
223
224 protected void SendValidationEvent(string code, string msg1, string msg2, string sourceUri, int lineNumber, int linePosition)
225 {
226 SendValidationEvent(new XmlSchemaException(code, new string[2] { msg1, msg2 }, sourceUri, lineNumber, linePosition), XmlSeverityType.Error);
227 }
228
233
235 {
237 }
238
243
245 {
246 if (severity == XmlSeverityType.Error)
247 {
248 _errorCount++;
249 }
250 if (_eventHandler != null)
251 {
253 }
254 else if (severity == XmlSeverityType.Error)
255 {
256 throw e;
257 }
258 }
259
261 {
262 if (severity == XmlSeverityType.Error)
263 {
264 _errorCount++;
265 }
266 if (_eventHandler != null)
267 {
269 }
270 }
271}
static string Sch_DupIdentityConstraint
Definition SR.cs:520
static string Sch_DupComplexType
Definition SR.cs:528
static string Sch_DupGlobalAttribute
Definition SR.cs:524
static string Sch_DupSimpleType
Definition SR.cs:526
static string Sch_DupGlobalElement
Definition SR.cs:522
static string Sch_DupAttributeGroup
Definition SR.cs:532
static string Sch_DupGroup
Definition SR.cs:530
static string Sch_DupNotation
Definition SR.cs:534
Definition SR.cs:7
static bool Equal(string strA, string strB)
Definition Ref.cs:5
readonly XmlNameTable _nameTable
void SendValidationEvent(string code, XmlSchemaObject source)
void AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item)
BaseProcessor(XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler)
void SendValidationEvent(XmlSchemaException e, XmlSeverityType severity)
BaseProcessor(XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler, XmlSchemaCompilationSettings compilationSettings)
bool IsValidGroupRedefine(XmlSchemaObject existingObject, XmlSchemaObject item, XmlSchemaObjectTable table)
XmlSchemaCompilationSettings CompilationSettings
void SendValidationEvent(string code, string[] args, Exception innerException, XmlSchemaObject source)
readonly ValidationEventHandler _eventHandler
bool IsValidAttributeGroupRedefine(XmlSchemaObject existingObject, XmlSchemaObject item, XmlSchemaObjectTable table)
void SendValidationEvent(string code, XmlSchemaObject source, XmlSeverityType severity)
void SendValidationEvent(string code, string msg1, string msg2, XmlSchemaObject source)
void SendValidationEvent(string code, string msg, XmlSchemaObject source, XmlSeverityType severity)
bool IsValidTypeRedefine(XmlSchemaObject existingObject, XmlSchemaObject item, XmlSchemaObjectTable table)
readonly XmlSchemaCompilationSettings _compilationSettings
void SendValidationEvent(string code, string msg1, string msg2, string sourceUri, int lineNumber, int linePosition)
void SendValidationEventNoThrow(XmlSchemaException e, XmlSeverityType severity)
void SendValidationEvent(string code, string msg, XmlSchemaObject source)
void SendValidationEvent(XmlSchemaException e)
static XmlSchema GetBuildInSchema()
void Insert(XmlQualifiedName name, XmlSchemaObject value)
void Add(XmlQualifiedName name, XmlSchemaObject value)
string Add(char[] array, int offset, int length)