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

◆ CompiledIdentityConstraint() [2/2]

System.Xml.Schema.CompiledIdentityConstraint.CompiledIdentityConstraint ( XmlSchemaIdentityConstraint constraint,
XmlNamespaceManager nsmgr )
inline

Definition at line 34 of file CompiledIdentityConstraint.cs.

35 {
36 name = constraint.QualifiedName;
37 try
38 {
39 _selector = new Asttree(constraint.Selector.XPath, isField: false, nsmgr);
40 }
41 catch (XmlSchemaException ex)
42 {
43 ex.SetSource(constraint.Selector);
44 throw;
45 }
46 XmlSchemaObjectCollection fields = constraint.Fields;
47 _fields = new Asttree[fields.Count];
48 for (int i = 0; i < fields.Count; i++)
49 {
50 try
51 {
52 _fields[i] = new Asttree(((XmlSchemaXPath)fields[i]).XPath, isField: true, nsmgr);
53 }
54 catch (XmlSchemaException ex2)
55 {
56 ex2.SetSource(constraint.Fields[i]);
57 throw;
58 }
59 }
60 if (constraint is XmlSchemaUnique)
61 {
62 _role = ConstraintRole.Unique;
63 return;
64 }
65 if (constraint is XmlSchemaKey)
66 {
68 return;
69 }
70 _role = ConstraintRole.Keyref;
71 refer = ((XmlSchemaKeyref)constraint).Refer;
72 }

References System.Xml.Schema.CompiledIdentityConstraint._fields, System.Xml.Schema.CompiledIdentityConstraint._role, System.Xml.Schema.CompiledIdentityConstraint._selector, System.Collections.CollectionBase.Count, System.Xml.Dictionary, System.Xml.Schema.XmlSchemaIdentityConstraint.Fields, System.Xml.Schema.CompiledIdentityConstraint.name, System.Xml.Schema.XmlSchemaIdentityConstraint.QualifiedName, System.Xml.Schema.CompiledIdentityConstraint.refer, System.Xml.Schema.XmlSchemaIdentityConstraint.Selector, and System.Xml.Schema.XmlSchemaXPath.XPath.