using System.Xml;
using System.Xml.Serialization;

namespace QC.CompareTestTree;

[XmlType(AnonymousType = true)]
public class SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTests
{
	private string nameField;

	private SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls[] parametersField;

	public string Name
	{
		get
		{
			return nameField;
		}
		set
		{
			nameField = value;
		}
	}

	[XmlArrayItem("ParameterCls", IsNullable = false)]
	public SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls[] Parameters
	{
		get
		{
			return parametersField;
		}
		set
		{
			parametersField = value;
		}
	}

	public void CompareRegistryTest(string xmlNodeName, SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTests baseRegTest, string overrideAttrib, ref XmlDocument xmlDoc, ref XmlElement parentNode)
	{
		XmlElement xmlElement = xmlDoc.CreateElement(xmlNodeName);
		if (overrideAttrib != null)
		{
			xmlElement.SetAttribute("delta", overrideAttrib);
		}
		CommonFunctions.RootDoc = xmlDoc;
		CommonFunctions.ParentNode = xmlElement;
		CommonFunctions.AddElement("Name", Name, baseRegTest.Name, overrideAttrib);
		xmlElement = xmlDoc.CreateElement("Parameters");
		if (overrideAttrib != null)
		{
			xmlElement.SetAttribute("delta", overrideAttrib);
		}
		if (baseRegTest.Parameters != null)
		{
			for (int i = 0; i < baseRegTest.Parameters.Length; i++)
			{
				int num = -1;
				SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls = (SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls)baseRegTest.Parameters.GetValue(i);
				SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls2;
				if (Parameters != null)
				{
					for (int j = 0; j < Parameters.Length; j++)
					{
						serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls2 = (SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls)Parameters.GetValue(j);
						if (serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls.Name == serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls2.Name)
						{
							num = j;
							break;
						}
					}
				}
				if (num < 0)
				{
					serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls.CompareTestParameters("ParameterCls", serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls, "Remove", ref xmlDoc, ref xmlElement);
					continue;
				}
				serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls2 = (SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls)Parameters.GetValue(num);
				serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls2.CompareTestParameters("ParameterCls", serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls, overrideAttrib, ref xmlDoc, ref xmlElement);
			}
		}
		if (Parameters != null)
		{
			for (int i = 0; i < Parameters.Length; i++)
			{
				int num = -1;
				SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls2 = (SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls)Parameters.GetValue(i);
				if (baseRegTest.Parameters != null)
				{
					for (int j = 0; j < baseRegTest.Parameters.Length; j++)
					{
						SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls = (SerializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls)baseRegTest.Parameters.GetValue(j);
						if (serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls2.Name == serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls.Name)
						{
							num = j;
							break;
						}
					}
				}
				if (num < 0)
				{
					serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls2.CompareTestParameters("ParameterCls", serializeComponentsTheRegistryQTMThisPCTargetTestContainersTestsParameterCls2, "Add", ref xmlDoc, ref xmlElement);
				}
			}
		}
		parentNode.AppendChild(xmlElement);
	}
}
