protected virtual void CompareToInner (string name, XmlNode node, XMLNameGroup other) { }
protected override void CompareToInner (string name, XmlNode parent, XMLNameGroup other) { Counters copy = counters; counters = new Counters (); try { base.CompareToInner (name, parent, other); AddCountersAttributes (parent); if (eventTypes == null) return; XMLEvents evt = (XMLEvents) other; string etype = eventTypes [name] as string; string oetype = null; if (evt.eventTypes != null) oetype = evt.eventTypes [name] as string; if (etype != oetype) AddWarning (parent, "Event type is {0} and should be {1}", oetype, etype); XMLMethods m = nameToMethod [name] as XMLMethods; XMLMethods om = evt.nameToMethod [name] as XMLMethods; if (m != null || om != null) { if (m == null) m = new XMLMethods (); m.CompareTo (document, parent, om); counters.AddPartialToPartial (m.Counters); } } finally { AddCountersAttributes (parent); copy.AddPartialToPartial (counters); counters = copy; } }
protected override void CompareToInner (string name, XmlNode parent, XMLNameGroup other) { // create backup of actual counters Counters copy = counters; // initialize counters for current method counters = new Counters(); try { base.CompareToInner(name, parent, other); XMLMethods methods = (XMLMethods) other; SignatureFlags flags = signatureFlags != null && signatureFlags.ContainsKey (name) ? (SignatureFlags) signatureFlags [name] : SignatureFlags.None; SignatureFlags oflags = methods.signatureFlags != null && methods.signatureFlags.ContainsKey (name) ? (SignatureFlags) methods.signatureFlags [name] : SignatureFlags.None; if (flags!= oflags) { if (flags == SignatureFlags.None) AddWarning (parent, String.Format ("should not be {0}", oflags)); else if (oflags == SignatureFlags.None) AddWarning (parent, String.Format ("should be {0}", flags)); else AddWarning (parent, String.Format ("{0} and should be {1}", oflags, flags)); } if (returnTypes != null) { string rtype = returnTypes[name] as string; string ortype = null; if (methods.returnTypes != null) ortype = methods.returnTypes[name] as string; if (rtype != ortype) AddWarning (parent, "Return type is {0} and should be {1}", ortype, rtype); } if (parameters != null) { XMLParameters parms = parameters[name] as XMLParameters; parms.CompareTo (document, parent, methods.parameters[name]); counters.AddPartialToPartial (parms.Counters); } } finally { // output counter attributes in result document AddCountersAttributes(parent); // add temporary counters to actual counters copy.AddPartialToPartial(counters); // restore backup of actual counters counters = copy; } }
protected override void CompareToInner (string name, XmlNode parent, XMLNameGroup other) { Counters copy = counters; counters = new Counters(); XMLProperties oprop = other as XMLProperties; if (oprop != null) { XMLMethods m = nameToMethod [name] as XMLMethods; XMLMethods om = oprop.nameToMethod [name] as XMLMethods; if (m != null || om != null) { if (m == null) m = new XMLMethods (); m.CompareTo(document, parent, om); counters.AddPartialToPartial(m.Counters); } } base.CompareToInner (name, parent, other); AddCountersAttributes(parent); copy.AddPartialToPartial(counters); counters = copy; }
protected override void CompareToInner (string name, XmlNode parent, XMLNameGroup other) { base.CompareToInner (name, parent, other); XMLFields fields = (XMLFields) other; if (fieldTypes != null) { string ftype = fieldTypes [name] as string; string oftype = null; if (fields.fieldTypes != null) oftype = fields.fieldTypes [name] as string; if (ftype != oftype) AddWarning (parent, "Field type is {0} and should be {1}", oftype, ftype); } if (fieldValues != null) { string fvalue = fieldValues [name] as string; string ofvalue = null; if (fields.fieldValues != null) ofvalue = fields.fieldValues [name] as string; if (fvalue != ofvalue) AddWarning (parent, "Field value is {0} and should be {1}", ofvalue, fvalue); } }
protected override void CompareToInner (string name, XmlNode parent, XMLNameGroup other) { base.CompareToInner (name, parent, other); XMLMember mb = other as XMLMember; XMLAttributes att = null; XMLAttributes oatt = null; if (attributeMap != null) att = attributeMap [name] as XMLAttributes; if (mb != null && mb.attributeMap != null) oatt = mb.attributeMap [name] as XMLAttributes; if (att != null || oatt != null) { if (att == null) att = new XMLAttributes (); att.CompareTo (document, parent, oatt); counters.AddPartialToPartial(att.Counters); if (oatt != null && oatt.IsTodo) { counters.Todo++; counters.ErrorTotal++; AddAttribute (parent, "error", "todo"); if (oatt.Comment != null) AddAttribute (parent, "comment", oatt.Comment); } } XMLMember member = (XMLMember) other; string acc = access [name] as string; if (acc == null) return; string oacc = null; if (member.access != null) oacc = member.access [name] as string; string accName = ConvertToString (Int32.Parse (acc)); string oaccName = ""; if (oacc != null) oaccName = ConvertToString (Int32.Parse (oacc)); if (accName != oaccName) AddWarning (parent, "Incorrect attributes: '{0}' != '{1}'", accName, oaccName); }
protected override void CompareToInner (string name, XmlNode parent, XMLNameGroup other) { base.CompareToInner (name, parent, other); XMLGenericGroup g = (XMLGenericGroup) other; if (attributes != g.attributes) AddWarning (parent, "Incorrect generic attributes: '{0}' != '{1}'", attributes, g.attributes); }
protected override void CompareToInner (string name, XmlNode node, XMLNameGroup other) { XMLAttributeProperties other_prop = ((XMLAttributes)other).properties [name] as XMLAttributeProperties; XMLAttributeProperties this_prop = properties [name] as XMLAttributeProperties; if (other_prop == null || this_prop == null) return; this_prop.CompareTo (document, node, other_prop); counters.AddPartialToPartial (this_prop.Counters); }