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

◆ PreprocessIdentityConstraint()

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

Definition at line 1029 of file SchemaCollectionPreprocessor.cs.

1030 {
1031 bool flag = true;
1032 PreprocessAnnotation(constraint);
1033 if (constraint.Name != null)
1034 {
1035 ValidateNameAttribute(constraint);
1036 constraint.SetQualifiedName(new XmlQualifiedName(constraint.Name, _targetNamespace));
1037 }
1038 else
1039 {
1041 flag = false;
1042 }
1043 if (_schema.IdentityConstraints[constraint.QualifiedName] != null)
1044 {
1045 SendValidationEvent(System.SR.Sch_DupIdentityConstraint, constraint.QualifiedName.ToString(), constraint);
1046 flag = false;
1047 }
1048 else
1049 {
1050 _schema.IdentityConstraints.Add(constraint.QualifiedName, constraint);
1051 }
1052 if (constraint.Selector == null)
1053 {
1055 flag = false;
1056 }
1057 if (constraint.Fields.Count == 0)
1058 {
1060 flag = false;
1061 }
1062 if (constraint is XmlSchemaKeyref)
1063 {
1064 XmlSchemaKeyref xmlSchemaKeyref = (XmlSchemaKeyref)constraint;
1065 if (xmlSchemaKeyref.Refer.IsEmpty)
1066 {
1068 flag = false;
1069 }
1070 else
1071 {
1073 }
1074 }
1075 if (flag)
1076 {
1077 ValidateIdAttribute(constraint);
1078 ValidateIdAttribute(constraint.Selector);
1079 SetParent(constraint.Selector, constraint);
1080 for (int i = 0; i < constraint.Fields.Count; i++)
1081 {
1082 SetParent(constraint.Fields[i], constraint);
1083 ValidateIdAttribute(constraint.Fields[i]);
1084 }
1085 }
1086 }
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 SetParent(XmlSchemaObject child, XmlSchemaObject parent)
void ValidateQNameAttribute(XmlSchemaObject xso, string attributeName, XmlQualifiedName value)
void Add(XmlQualifiedName name, XmlSchemaObject value)
XmlSchemaObjectTable IdentityConstraints
Definition XmlSchema.cs:313

References System.Xml.Schema.SchemaCollectionPreprocessor._schema, System.Xml.Schema.SchemaCollectionPreprocessor._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.SchemaCollectionPreprocessor.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.SchemaCollectionPreprocessor.SetParent(), System.Xml.Schema.XmlSchemaIdentityConstraint.SetQualifiedName(), System.Xml.XmlQualifiedName.ToString(), System.Xml.Schema.SchemaCollectionPreprocessor.ValidateIdAttribute(), System.Xml.Schema.SchemaCollectionPreprocessor.ValidateNameAttribute(), and System.Xml.Schema.SchemaCollectionPreprocessor.ValidateQNameAttribute().

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