using System.Xml;

namespace QC.CompareTestTree;

public class ScriptProperties : TestProperties
{
	private string workingDirectory;

	private bool useShellExecute;

	private bool redirectStandardOutput;

	private bool createNoWindow;

	private string verb;

	public bool RedirectStandardOutput
	{
		get
		{
			return redirectStandardOutput;
		}
		set
		{
			redirectStandardOutput = value;
		}
	}

	public string WorkingDirectory
	{
		get
		{
			return workingDirectory;
		}
		set
		{
			workingDirectory = value;
		}
	}

	public bool UseShellExecute
	{
		get
		{
			return useShellExecute;
		}
		set
		{
			useShellExecute = value;
		}
	}

	public string Verb
	{
		get
		{
			return verb;
		}
		set
		{
			verb = value;
		}
	}

	public bool CreateNoWindow
	{
		get
		{
			return createNoWindow;
		}
		set
		{
			createNoWindow = value;
		}
	}

	internal void CompareProperties(string XmlTagName, ScriptProperties baseProperties, string overrideAttrib, ref XmlDocument xmlDoc, ref XmlElement theTestNode)
	{
		XmlElement parentNode = xmlDoc.CreateElement(XmlTagName);
		parentNode.SetAttribute("NodeType", "FolderProperty");
		CompareProperties(baseProperties, overrideAttrib, ref xmlDoc, ref parentNode);
		CommonFunctions.RootDoc = xmlDoc;
		CommonFunctions.ParentNode = parentNode;
		CommonFunctions.AddElement("RedirectStandardOutput", RedirectStandardOutput, baseProperties.RedirectStandardOutput, overrideAttrib);
		CommonFunctions.AddElement("WorkingDirectory", WorkingDirectory, baseProperties.WorkingDirectory, overrideAttrib);
		CommonFunctions.AddElement("UseShellExecute", UseShellExecute, baseProperties.UseShellExecute, overrideAttrib);
		CommonFunctions.AddElement("Verb", Verb, baseProperties.Verb, overrideAttrib);
		CommonFunctions.AddElement("CreateNoWindow", CreateNoWindow, baseProperties.CreateNoWindow, overrideAttrib);
		XmlElement rootNode = xmlDoc.CreateElement("Statistics");
		Statistics.DetermineStatics(parentNode, ref xmlDoc, ref rootNode);
		parentNode.AppendChild(rootNode);
		theTestNode.AppendChild(parentNode);
	}
}
