Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ PreprocessIdentityConstraint()

void System.Xml.Schema.Preprocessor.PreprocessIdentityConstraint ( XmlSchemaIdentityConstraint constraint)
inlineprivate

Definition at line 1281 of file Preprocessor.cs.

1282 {
1283 bool flag = true;
1284 PreprocessAnnotation(constraint);
1285 if (constraint.Name != null)
1286 {
1287 ValidateNameAttribute(constraint);
1288 constraint.SetQualifiedName(new XmlQualifiedName(constraint.Name, _targetNamespace));
1289 }
1290 else
1291 {
1293 flag = false;
1294 }
1295 if (_rootSchema.IdentityConstraints[constraint.QualifiedName] != null)
1296 {
1297 SendValidationEvent(System.SR.Sch_DupIdentityConstraint, constraint.QualifiedName.ToString(), constraint);
1298 flag = false;
1299 }
1300 else
1301 {
1302 _rootSchema.IdentityConstraints.Add(constraint.QualifiedName, constraint);
1303 }
1304 if (constraint.Selector == null)
1305 {
1307 flag = false;
1308 }
1309 if (constraint.Fields.Count == 0)
1310 {
1312 flag = false;
1313 }
1314 if (constraint is XmlSchemaKeyref)
1315 {
1316 XmlSchemaKeyref xmlSchemaKeyref = (XmlSchemaKeyref)constraint;
1317 if (xmlSchemaKeyref.Refer.IsEmpty)
1318 {
1320 flag = false;
1321 }
1322 else
1323 {
1325 }
1326 }
1327 if (flag)
1328 {
1329 ValidateIdAttribute(constraint);
1330 ValidateIdAttribute(constraint.Selector);
1331 SetParent(constraint.Selector, constraint);
1332 for (int i = 0; i < constraint.Fields.Count; i++)
1333 {
1334 SetParent(constraint.Fields[i], constraint);
1335 ValidateIdAttribute(constraint.Fields[i]);
1336 }
1337 }
1338 }
static string Sch_IdConstraintNoFields
Definition SR.cs:840
static string Sch_DupIdentityConstraint
Definition SR.cs:520
static string Sch_IdConstraintNoRefer
Definition SR.cs:842
static string Sch_IdConstraintNoSelector
Definition SR.cs:838
static string Sch_MissRequiredAttribute
Definition SR.cs:490
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
void PreprocessAnnotation(XmlSchemaObject schemaObject)
void ValidateNameAttribute(XmlSchemaObject xso)
void SetParent(XmlSchemaObject child, XmlSchemaObject parent)
void ValidateIdAttribute(XmlSchemaObject xso)
void ValidateQNameAttribute(XmlSchemaObject xso, string attributeName, XmlQualifiedName value)
void Add(XmlQualifiedName name, XmlSchemaObject value)
XmlSchemaObjectTable IdentityConstraints
Definition XmlSchema.cs:313

References System.Xml.Schema.Preprocessor._rootSchema, System.Xml.Schema.Preprocessor._targetNamespace, System.Xml.Schema.XmlSchemaObjectTable.Add(), System.Collections.CollectionBase.Count, System.Xml.Schema.XmlSchemaIdentityConstraint.Fields, System.Xml.Schema.XmlSchema.IdentityConstraints, System.Xml.Schema.XmlSchemaIdentityConstraint.Name, System.Xml.Schema.Preprocessor.PreprocessAnnotation(), System.Xml.Schema.XmlSchemaIdentityConstraint.QualifiedName, System.SR.Sch_DupIdentityConstraint, System.SR.Sch_IdConstraintNoFields, System.SR.Sch_IdConstraintNoRefer, System.SR.Sch_IdConstraintNoSelector, System.SR.Sch_MissRequiredAttribute, System.Xml.Schema.XmlSchemaIdentityConstraint.Selector, System.Xml.Schema.BaseProcessor.SendValidationEvent(), System.Xml.Schema.Preprocessor.SetParent(), System.Xml.Schema.XmlSchemaIdentityConstraint.SetQualifiedName(), System.Xml.XmlQualifiedName.ToString(), System.Xml.Schema.Preprocessor.ValidateIdAttribute(), System.Xml.Schema.Preprocessor.ValidateNameAttribute(), and System.Xml.Schema.Preprocessor.ValidateQNameAttribute().

Referenced by System.Xml.Schema.Preprocessor.PreprocessElementContent().