public void AddPartialToPartial (Counters other)
		{
			Present += other.Present;
			Extra += other.Extra;
			Missing += other.Missing;

			Todo += other.Todo;
			Warning += other.Warning;
			AddPartialToTotal (other);
		}
		public void AddTotalToPartial (Counters other)
		{
			Present += other.PresentTotal;
			Extra += other.ExtraTotal;
			Missing += other.MissingTotal;

			Todo += other.TodoTotal;
			Warning += other.WarningTotal;
			AddTotalToTotal (other);
		}
		public void AddPartialToTotal (Counters other)
		{
			PresentTotal += other.Present;
			ExtraTotal += other.Extra;
			MissingTotal += other.Missing;

			TodoTotal += other.Todo;
			WarningTotal += other.Warning;
		}
		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 ();

			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;
			}
		}
		public XMLData ()
		{
			counters = new Counters ();
		}
		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;
		}
		public void AddTotalToTotal (Counters other)
		{
			PresentTotal += other.PresentTotal;
			ExtraTotal += other.ExtraTotal;
			MissingTotal += other.MissingTotal;

			TodoTotal += other.TodoTotal;
			WarningTotal += other.WarningTotal;
			ErrorTotal += other.ErrorTotal;
		}