using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Xml.Schema;
using System.Xml.Serialization;
using QDART_MFG_CfgEditor;

[Serializable]
[GeneratedCode("xsd", "4.0.30319.1")]
[DesignerCategory("code")]
[XmlType(AnonymousType = true)]
[DebuggerStepThrough]
public class RootConfig
{
	private LanguageDetails.Language currLanguage;

	private string stationField;

	private string languageField;

	private string autoStartField;

	private string multiDUTField;

	private string dUTsField;

	private string blankWhenNullField;

	private string saveAsField;

	private string backupField;

	private RootConfigAll[] allField;

	public LanguageDetails.Language LanguageUsed
	{
		get
		{
			return currLanguage;
		}
		set
		{
			currLanguage = value;
		}
	}

	[XmlElement(Form = XmlSchemaForm.Unqualified)]
	public string Station
	{
		get
		{
			return stationField;
		}
		set
		{
			stationField = value;
		}
	}

	[XmlElement(Form = XmlSchemaForm.Unqualified)]
	public string Language
	{
		get
		{
			return languageField;
		}
		set
		{
			switch (value)
			{
			case "ENGLISH":
				languageField = value;
				break;
			case "CHINESE":
				languageField = value;
				break;
			default:
				languageField = "ENGLISH";
				break;
			}
		}
	}

	[XmlElement(Form = XmlSchemaForm.Unqualified)]
	public string AutoStart
	{
		get
		{
			return autoStartField;
		}
		set
		{
			if (bool.TryParse(value, out var _))
			{
				autoStartField = value;
				return;
			}
			Exception ex = new Exception("Invalid data type for AutoStart ");
			throw ex;
		}
	}

	[XmlElement(Form = XmlSchemaForm.Unqualified)]
	public string MultiDUT
	{
		get
		{
			return multiDUTField;
		}
		set
		{
			if (bool.TryParse(value, out var _))
			{
				multiDUTField = value;
				return;
			}
			Exception ex = new Exception("Invalid data type for MultiDUTField ");
			throw ex;
		}
	}

	[XmlElement(Form = XmlSchemaForm.Unqualified)]
	public string DUTs
	{
		get
		{
			return dUTsField;
		}
		set
		{
			if (int.TryParse(value, out var _))
			{
				dUTsField = value;
				return;
			}
			Exception ex = new Exception("Invalid data type for DUTs ");
			throw ex;
		}
	}

	[XmlElement(Form = XmlSchemaForm.Unqualified)]
	public string BlankWhenNull
	{
		get
		{
			return blankWhenNullField;
		}
		set
		{
			if (bool.TryParse(value, out var _))
			{
				blankWhenNullField = value;
				return;
			}
			Exception ex = new Exception("Invalid data type for BlankWhenNullField ");
			throw ex;
		}
	}

	[XmlElement(Form = XmlSchemaForm.Unqualified)]
	public string SaveAs
	{
		get
		{
			return saveAsField;
		}
		set
		{
			if (bool.TryParse(value, out var _))
			{
				saveAsField = value;
				return;
			}
			Exception ex = new Exception("Invalid data type for SaveAs ");
			throw ex;
		}
	}

	[XmlElement(Form = XmlSchemaForm.Unqualified)]
	public string Backup
	{
		get
		{
			return backupField;
		}
		set
		{
			if (bool.TryParse(value, out var _))
			{
				backupField = value;
				return;
			}
			Exception ex = new Exception("Invalid data type for Backup ");
			throw ex;
		}
	}

	[XmlElement("All", Form = XmlSchemaForm.Unqualified)]
	public RootConfigAll[] All
	{
		get
		{
			return allField;
		}
		set
		{
			allField = value;
		}
	}
}
