Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ContentValidator.cs
Go to the documentation of this file.
2
3namespace System.Xml.Schema;
4
5internal class ContentValidator
6{
8
9 private bool _isOpen;
10
11 private readonly bool _isEmptiable;
12
13 public static readonly ContentValidator Empty = new ContentValidator(XmlSchemaContentType.Empty);
14
16
17 public static readonly ContentValidator Mixed = new ContentValidator(XmlSchemaContentType.Mixed);
18
20
22
24 {
25 get
26 {
27 if (_contentType != 0)
28 {
29 return _contentType == XmlSchemaContentType.Mixed;
30 }
31 return true;
32 }
33 }
34
35 public virtual bool IsEmptiable => _isEmptiable;
36
37 public bool IsOpen
38 {
39 get
40 {
42 {
43 return false;
44 }
45 return _isOpen;
46 }
47 set
48 {
49 _isOpen = value;
50 }
51 }
52
58
65
66 public virtual void InitValidation(ValidationState context)
67 {
68 }
69
70 public virtual object ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
71 {
73 {
75 }
76 errorCode = -1;
77 return null;
78 }
79
80 public virtual bool CompleteValidation(ValidationState context)
81 {
82 return true;
83 }
84
86 {
87 return null;
88 }
89
91 {
92 return null;
93 }
94
99
101 {
102 if (!particles.Contains(p))
103 {
104 particles.Add(p);
105 }
106 if (!(p is XmlSchemaElement xmlSchemaElement) || (!global && xmlSchemaElement.RefName.IsEmpty))
107 {
108 return;
109 }
110 XmlSchemaObjectTable substitutionGroups = schemaSet.SubstitutionGroups;
112 if (xmlSchemaSubstitutionGroup == null)
113 {
114 return;
115 }
116 for (int i = 0; i < xmlSchemaSubstitutionGroup.Members.Count; i++)
117 {
119 if (!xmlSchemaElement.QualifiedName.Equals(xmlSchemaElement2.QualifiedName) && !particles.Contains(xmlSchemaElement2))
120 {
122 }
123 }
124 }
125}
virtual void InitValidation(ValidationState context)
virtual bool CompleteValidation(ValidationState context)
ContentValidator(XmlSchemaContentType contentType, bool isOpen, bool isEmptiable)
readonly XmlSchemaContentType _contentType
virtual ArrayList ExpectedParticles(ValidationState context, bool isRequiredOnly, XmlSchemaSet schemaSet)
static readonly ContentValidator Any
static void AddParticleToExpected(XmlSchemaParticle p, XmlSchemaSet schemaSet, ArrayList particles)
ContentValidator(XmlSchemaContentType contentType)
virtual object ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
static readonly ContentValidator Mixed
static readonly ContentValidator TextOnly
virtual ArrayList ExpectedElements(ValidationState context, bool isRequiredOnly)
static void AddParticleToExpected(XmlSchemaParticle p, XmlSchemaSet schemaSet, ArrayList particles, bool global)