Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DfaContentValidator.cs
Go to the documentation of this file.
2
3namespace System.Xml.Schema;
4
5internal sealed class DfaContentValidator : ContentValidator
6{
7 private readonly int[][] _transitionTable;
8
9 private readonly SymbolsDictionary _symbols;
10
17
18 public override void InitValidation(ValidationState context)
19 {
22 }
23
24 public override object ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
25 {
26 int num = _symbols[name];
27 int num2 = _transitionTable[context.CurrentState.State][num];
28 errorCode = 0;
29 if (num2 != -1)
30 {
33 return _symbols.GetParticle(num);
34 }
35 if (base.IsOpen && context.HasMatched)
36 {
37 return null;
38 }
40 errorCode = -1;
41 return null;
42 }
43
44 public override bool CompleteValidation(ValidationState context)
45 {
46 if (!context.HasMatched)
47 {
48 return false;
49 }
50 return true;
51 }
52
54 {
55 ArrayList arrayList = null;
57 if (array != null)
58 {
59 for (int i = 0; i < array.Length - 1; i++)
60 {
61 if (array[i] == -1)
62 {
63 continue;
64 }
65 if (arrayList == null)
66 {
67 arrayList = new ArrayList();
68 }
70 if (xmlSchemaParticle == null)
71 {
72 string text = _symbols.NameOf(i);
73 if (text.Length != 0)
74 {
75 arrayList.Add(text);
76 }
77 }
78 else
79 {
80 string nameString = xmlSchemaParticle.NameString;
81 if (!arrayList.Contains(nameString))
82 {
84 }
85 }
86 }
87 }
88 return arrayList;
89 }
90
92 {
95 if (array != null)
96 {
97 for (int i = 0; i < array.Length - 1; i++)
98 {
99 if (array[i] != -1)
100 {
102 if (xmlSchemaParticle != null)
103 {
105 }
106 }
107 }
108 }
109 return arrayList;
110 }
111}
static void AddParticleToExpected(XmlSchemaParticle p, XmlSchemaSet schemaSet, ArrayList particles)
override object ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
override void InitValidation(ValidationState context)
override bool CompleteValidation(ValidationState context)
override ArrayList ExpectedParticles(ValidationState context, bool isRequiredOnly, XmlSchemaSet schemaSet)
override ArrayList ExpectedElements(ValidationState context, bool isRequiredOnly)
DfaContentValidator(int[][] transitionTable, SymbolsDictionary symbols, XmlSchemaContentType contentType, bool isOpen, bool isEmptiable)