using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml.Serialization;

namespace QC.QSPRLogSchema;

[Serializable]
[XmlType(AnonymousType = true)]
public class Tester
{
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private List<TestLibrary> swConfigInfoField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private List<DataItem> equipmentConfigField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string workStationField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string testerIDField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string treeIDField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string typeField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string appNameField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string versionField;

	[XmlArrayItem(typeof(TestLibrary), ElementName = "TestLib", IsNullable = false)]
	[XmlArray("SWConfigInfo", IsNullable = false)]
	public List<TestLibrary> SoftwareConfigurationInfoItems
	{
		get
		{
			return swConfigInfoField;
		}
		set
		{
			swConfigInfoField = value;
		}
	}

	[XmlArrayItem(typeof(DataItem), ElementName = "DI", IsNullable = false)]
	[XmlArray("EquipmentConfig", IsNullable = false)]
	public List<DataItem> EquipmentConfigurationDataItems
	{
		get
		{
			return equipmentConfigField;
		}
		set
		{
			equipmentConfigField = value;
		}
	}

	[XmlAttribute]
	public string WorkStation
	{
		get
		{
			return workStationField;
		}
		set
		{
			workStationField = value;
		}
	}

	[XmlAttribute]
	public string TesterID
	{
		get
		{
			return testerIDField;
		}
		set
		{
			testerIDField = value;
		}
	}

	[XmlAttribute]
	public string TreeID
	{
		get
		{
			return treeIDField;
		}
		set
		{
			treeIDField = value;
		}
	}

	[XmlAttribute]
	public string Type
	{
		get
		{
			return typeField;
		}
		set
		{
			typeField = value;
		}
	}

	[XmlAttribute("App")]
	public string ApplicationName
	{
		get
		{
			return appNameField;
		}
		set
		{
			appNameField = value;
		}
	}

	[XmlAttribute("V")]
	public string Version
	{
		get
		{
			return versionField;
		}
		set
		{
			versionField = value;
		}
	}

	public bool ShouldSerializeSoftwareConfigurationInfoItems()
	{
		if (SoftwareConfigurationInfoItems != null)
		{
			return SoftwareConfigurationInfoItems.Count > 0;
		}
		return false;
	}

	public bool ShouldSerializeEquipmentConfigurationDataItems()
	{
		if (EquipmentConfigurationDataItems != null)
		{
			return EquipmentConfigurationDataItems.Count > 0;
		}
		return false;
	}

	public bool ShouldSerializeWorkStation()
	{
		return !string.IsNullOrEmpty(WorkStation);
	}

	public bool ShouldSerializeTesterID()
	{
		return !string.IsNullOrEmpty(TesterID);
	}

	public bool ShouldSerializeTreeID()
	{
		return !string.IsNullOrEmpty(TreeID);
	}

	public bool ShouldSerializeType()
	{
		return !string.IsNullOrEmpty(Type);
	}

	public bool ShouldSerializeApplicationName()
	{
		return !string.IsNullOrEmpty(ApplicationName);
	}

	public bool ShouldSerializeVersion()
	{
		return !string.IsNullOrEmpty(Version);
	}

	public Tester()
	{
		swConfigInfoField = new List<TestLibrary>();
		equipmentConfigField = new List<DataItem>();
		workStationField = string.Empty;
		testerIDField = string.Empty;
		typeField = string.Empty;
		treeIDField = string.Empty;
	}

	public Tester(List<TestLibrary> swConfigInfo = null, List<DataItem> equipmentConfig = null, string workStation = null, string testerID = null, string type = null, string appName = null, string version = null, string treeID = null)
	{
		if (swConfigInfo != null)
		{
			swConfigInfoField = swConfigInfo;
		}
		else
		{
			swConfigInfoField = new List<TestLibrary>();
		}
		if (equipmentConfig != null)
		{
			equipmentConfigField = equipmentConfig;
		}
		else
		{
			equipmentConfigField = new List<DataItem>();
		}
		if (!string.IsNullOrEmpty(workStation))
		{
			workStationField = workStation;
		}
		else
		{
			workStationField = string.Empty;
		}
		if (!string.IsNullOrEmpty(testerID))
		{
			testerIDField = testerID;
		}
		else
		{
			testerIDField = string.Empty;
		}
		if (!string.IsNullOrEmpty(type))
		{
			typeField = type;
		}
		else
		{
			typeField = string.Empty;
		}
		if (!string.IsNullOrEmpty(appName))
		{
			appNameField = appName;
		}
		else
		{
			appNameField = string.Empty;
		}
		if (!string.IsNullOrEmpty(version))
		{
			versionField = version;
		}
		else
		{
			versionField = string.Empty;
		}
		if (!string.IsNullOrEmpty(treeID))
		{
			treeIDField = treeID;
		}
		else
		{
			treeIDField = string.Empty;
		}
	}
}
