Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SchemaElementDecl.cs
Go to the documentation of this file.
3
4namespace System.Xml.Schema;
5
7{
9
11
12 private bool _isIdDeclared;
13
15
16 private bool _isAbstract;
17
18 private bool _isNillable;
19
21
22 private bool _isNotationDeclared;
23
25
27
29
31
33
35
36 internal static readonly SchemaElementDecl Empty = new SchemaElementDecl();
37
39
41
43
44 internal bool IsIdDeclared
45 {
46 get
47 {
48 return _isIdDeclared;
49 }
50 set
51 {
53 }
54 }
55
57 {
58 get
59 {
61 }
62 set
63 {
65 }
66 }
67
68 internal bool IsAbstract
69 {
70 get
71 {
72 return _isAbstract;
73 }
74 set
75 {
77 }
78 }
79
80 internal bool IsNillable
81 {
82 get
83 {
84 return _isNillable;
85 }
86 set
87 {
89 }
90 }
91
93 {
94 get
95 {
96 return _block;
97 }
98 set
99 {
100 _block = value;
101 }
102 }
103
104 internal bool IsNotationDeclared
105 {
106 get
107 {
108 return _isNotationDeclared;
109 }
110 set
111 {
113 }
114 }
115
116 internal bool HasDefaultAttribute => _defaultAttdefs != null;
117
119
121 {
122 get
123 {
124 return _contentValidator;
125 }
126 set
127 {
129 }
130 }
131
133 {
134 get
135 {
136 return _anyAttribute;
137 }
138 set
139 {
141 }
142 }
143
145 {
146 get
147 {
148 return _constraints;
149 }
150 set
151 {
153 }
154 }
155
157 {
158 get
159 {
160 return _schemaElement;
161 }
162 set
163 {
165 }
166 }
167
169
171
173
175 {
176 }
177
183
185 : base(name, prefix)
186 {
187 }
188
195
197 {
200 {
201 return value;
202 }
203 return null;
204 }
205
210
212 {
213 foreach (SchemaAttDef value in _attdefs.Values)
214 {
215 if (value.TokenizedType == XmlTokenizedType.ID)
216 {
217 return value;
218 }
219 }
220 return null;
221 }
222
224 {
225 return (SchemaElementDecl)MemberwiseClone();
226 }
227
229 {
230 _attdefs.Add(attdef.Name, attdef);
231 if (attdef.Presence == Use.Required || attdef.Presence == Use.RequiredFixed)
232 {
234 }
235 if (attdef.Presence == Use.Default || attdef.Presence == Use.Fixed)
236 {
237 if (_defaultAttdefs == null)
238 {
240 }
242 }
243 }
244
246 {
247 if (_attdefs.TryGetValue(qname, out var value))
248 {
249 return value;
250 }
251 return null;
252 }
253
255 {
256 foreach (SchemaAttDef value in _attdefs.Values)
257 {
258 if (presence[value.Name] == null)
259 {
260 if (value.Presence == Use.Required)
261 {
262 throw new XmlSchemaException(System.SR.Sch_MissRequiredAttribute, value.Name.ToString());
263 }
264 if (standalone && value.IsDeclaredInExternal && (value.Presence == Use.Default || value.Presence == Use.Fixed))
265 {
266 throw new XmlSchemaException(System.SR.Sch_StandAlone, string.Empty);
267 }
268 }
269 }
270 }
271}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
void Add(TKey key, TValue value)
static string Sch_StandAlone
Definition SR.cs:590
static string Sch_MissRequiredAttribute
Definition SR.cs:490
Definition SR.cs:7
static readonly ContentValidator TextOnly
Dictionary< XmlQualifiedName, XmlQualifiedName > ProhibitedAttributes
SchemaAttDef GetAttDef(XmlQualifiedName qname)
readonly Dictionary< XmlQualifiedName, XmlQualifiedName > _prohibitedAttributes
readonly Dictionary< XmlQualifiedName, SchemaAttDef > _attdefs
CompiledIdentityConstraint[] _constraints
string IDtdAttributeListInfo. Prefix
static SchemaElementDecl CreateAnyTypeElementDecl()
List< IDtdDefaultAttributeInfo > _defaultAttdefs
Dictionary< XmlQualifiedName, SchemaAttDef > AttDefs
SchemaElementDecl(XmlSchemaDatatype dtype)
SchemaElementDecl(XmlQualifiedName name, string prefix)
void CheckAttributes(Hashtable presence, bool standalone)
IList< IDtdDefaultAttributeInfo > DefaultAttDefs
void AddAttDef(SchemaAttDef attdef)
CompiledIdentityConstraint[] Constraints
IDtdAttributeInfo LookupAttribute(string prefix, string localName)
IDtdAttributeInfo LookupIdAttribute()
IEnumerable< IDtdDefaultAttributeInfo > LookupDefaultAttributes()