private CompoundPropertyToken LoadCompoundProperty(XmlNode compoundPropertyNode, int index) { using (this.StackFrame(compoundPropertyNode, index)) { CompoundPropertyToken cpt = new CompoundPropertyToken(); List <XmlNode> unprocessedNodes = new List <XmlNode>(); bool success = LoadPropertyBaseHelper(compoundPropertyNode, cpt, unprocessedNodes); if (!success) { return(null); } cpt.control = null; // mutually exclusive bool complexControlFound = false; // cardinality 0..1 bool fieldControlFound = false; // cardinality 0..1 ComplexControlMatch controlMatch = new ComplexControlMatch(this); FieldControlBody fieldControlBody = null; foreach (XmlNode n in unprocessedNodes) { if (controlMatch.MatchNode(n)) { if (complexControlFound) { this.ProcessDuplicateAlternateNode(n, XmlTags.ComplexControlNode, XmlTags.ComplexControlNameNode); return(null); } complexControlFound = true; if (!controlMatch.ProcessNode(n)) { return(null); // fatal error } } else if (MatchNodeName(n, XmlTags.FieldControlNode)) { if (fieldControlFound) { this.ProcessDuplicateAlternateNode(n, XmlTags.ComplexControlNode, XmlTags.ComplexControlNameNode); return(null); // fatal error } fieldControlFound = true; fieldControlBody = new FieldControlBody(); fieldControlBody.fieldFormattingDirective.formatString = GetMandatoryInnerText(n); if (fieldControlBody.fieldFormattingDirective.formatString == null) { return(null); // fatal error } } else { ProcessUnknownNode(n); } } if (fieldControlFound && complexControlFound) { this.ProcessDuplicateAlternateNode(XmlTags.ComplexControlNode, XmlTags.ComplexControlNameNode); return(null); // fatal error } if (fieldControlFound) { cpt.control = fieldControlBody; } else { cpt.control = controlMatch.Control; } /* * if (cpt.control == null) * { * this.ReportMissingNodes ( * new string[] { XmlTags.FieldControlNode, XmlTags.ComplexControlNode, XmlTags.ComplexControlNameNode }); * return null; * } */ return(cpt); } }
private CompoundPropertyToken LoadCompoundProperty(System.Xml.XmlNode compoundPropertyNode, int index) { using (base.StackFrame(compoundPropertyNode, index)) { CompoundPropertyToken ptb = new CompoundPropertyToken(); List<System.Xml.XmlNode> unprocessedNodes = new List<System.Xml.XmlNode>(); if (!this.LoadPropertyBaseHelper(compoundPropertyNode, ptb, unprocessedNodes)) { return null; } ptb.control = null; bool flag2 = false; bool flag3 = false; ComplexControlMatch match = new ComplexControlMatch(this); FieldControlBody body = null; foreach (System.Xml.XmlNode node in unprocessedNodes) { if (match.MatchNode(node)) { if (flag2) { base.ProcessDuplicateAlternateNode(node, "CustomControl", "CustomControlName"); return null; } flag2 = true; if (!match.ProcessNode(node)) { return null; } } else if (base.MatchNodeName(node, "FieldControl")) { if (flag3) { base.ProcessDuplicateAlternateNode(node, "CustomControl", "CustomControlName"); return null; } flag3 = true; body = new FieldControlBody { fieldFormattingDirective = { formatString = base.GetMandatoryInnerText(node) } }; if (body.fieldFormattingDirective.formatString == null) { return null; } } else { base.ProcessUnknownNode(node); } } if (flag3 && flag2) { base.ProcessDuplicateAlternateNode("CustomControl", "CustomControlName"); return null; } if (flag3) { ptb.control = body; } else { ptb.control = match.Control; } return ptb; } }
private CompoundPropertyToken LoadCompoundProperty(XmlNode compoundPropertyNode, int index) { using (this.StackFrame(compoundPropertyNode, index)) { CompoundPropertyToken cpt = new CompoundPropertyToken(); List<XmlNode> unprocessedNodes = new List<XmlNode>(); bool success = LoadPropertyBaseHelper(compoundPropertyNode, cpt, unprocessedNodes); if (!success) { return null; } cpt.control = null; // mutually exclusive bool complexControlFound = false; // cardinality 0..1 bool fieldControlFound = false; // cardinality 0..1 ComplexControlMatch controlMatch = new ComplexControlMatch(this); FieldControlBody fieldControlBody = null; foreach (XmlNode n in unprocessedNodes) { if (controlMatch.MatchNode(n)) { if (complexControlFound) { this.ProcessDuplicateAlternateNode(n, XmlTags.ComplexControlNode, XmlTags.ComplexControlNameNode); return null; } complexControlFound = true; if (!controlMatch.ProcessNode(n)) return null; // fatal error } else if (MatchNodeName(n, XmlTags.FieldControlNode)) { if (fieldControlFound) { this.ProcessDuplicateAlternateNode(n, XmlTags.ComplexControlNode, XmlTags.ComplexControlNameNode); return null; // fatal error } fieldControlFound = true; fieldControlBody = new FieldControlBody(); fieldControlBody.fieldFormattingDirective.formatString = GetMandatoryInnerText(n); if (fieldControlBody.fieldFormattingDirective.formatString == null) { return null; // fatal error } } else { ProcessUnknownNode(n); } } if (fieldControlFound && complexControlFound) { this.ProcessDuplicateAlternateNode(XmlTags.ComplexControlNode, XmlTags.ComplexControlNameNode); return null; // fatal error } if (fieldControlFound) { cpt.control = fieldControlBody; } else { cpt.control = controlMatch.Control; } /* if (cpt.control == null) { this.ReportMissingNodes ( new string[] { XmlTags.FieldControlNode, XmlTags.ComplexControlNode, XmlTags.ComplexControlNameNode }); return null; } */ return cpt; } }