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

namespace QC.CTDS.DM.DataStructures.FormatDescriptorStructure;

[Serializable]
public class ScatteredChartSeries : DiscriminatorElement, IDataErrorInfo
{
	private string _testID;

	private bool _groupByTC;

	private bool _groupAll;

	private bool isSelected;

	private string groupName;

	private SeriesDisplayProperties displayProperties = new SeriesDisplayProperties();

	private Series_Var indVar = new Series_Var();

	private Series_Var depVar = new Series_Var();

	private bool _sort;

	[XmlAttribute]
	public string testID
	{
		get
		{
			return _testID;
		}
		set
		{
			if (!(_testID == value))
			{
				_testID = value.Trim();
				OnPropertyChanged("testID");
			}
		}
	}

	[XmlAttribute]
	[DefaultValue(false)]
	public bool groupByTC
	{
		get
		{
			return _groupByTC;
		}
		set
		{
			if (_groupByTC != value)
			{
				_groupByTC = value;
				OnPropertyChanged("groupByTC");
			}
		}
	}

	[DefaultValue(false)]
	[XmlAttribute]
	public bool groupAll
	{
		get
		{
			return _groupAll;
		}
		set
		{
			if (_groupAll != value)
			{
				_groupAll = value;
				OnPropertyChanged("groupAll");
			}
		}
	}

	[XmlIgnore]
	public bool IsSelected
	{
		get
		{
			return isSelected;
		}
		set
		{
			if (isSelected != value)
			{
				isSelected = value;
				OnPropertyChanged("IsSelected");
			}
		}
	}

	[XmlIgnore]
	public string GroupName
	{
		get
		{
			return groupName;
		}
		set
		{
			groupName = value;
		}
	}

	[DefaultValue(null)]
	public SeriesDisplayProperties DisplayProperties
	{
		get
		{
			return displayProperties;
		}
		set
		{
			if (displayProperties != value)
			{
				displayProperties = value;
				OnPropertyChanged("DisplayProperties");
			}
		}
	}

	[DefaultValue(null)]
	public Series_Var IndVar
	{
		get
		{
			return indVar;
		}
		set
		{
			if (indVar != value)
			{
				indVar = value;
				OnPropertyChanged("IndVar");
			}
		}
	}

	[DefaultValue(null)]
	public Series_Var DepVar
	{
		get
		{
			return depVar;
		}
		set
		{
			if (depVar != value)
			{
				depVar = value;
				OnPropertyChanged("DepVar");
			}
		}
	}

	public string Error
	{
		get
		{
			throw new NotImplementedException();
		}
	}

	public string this[string columnName]
	{
		get
		{
			string result = null;
			if (columnName == "testID" && string.IsNullOrEmpty(testID))
			{
				result = "TestName cannot be null or empty";
			}
			return result;
		}
	}

	[XmlAttribute]
	[DefaultValue(false)]
	public bool sort
	{
		get
		{
			return _sort;
		}
		set
		{
			if (_sort != value)
			{
				_sort = value;
				base.OnPropertyChanged("sort");
			}
		}
	}

	public ScatteredChartSeries()
	{
	}

	public ScatteredChartSeries(ScatteredChartSeries scSeries)
		: base(scSeries)
	{
		_testID = scSeries._testID;
		_groupByTC = scSeries._groupByTC;
		_groupAll = scSeries._groupAll;
		isSelected = scSeries.isSelected;
		_sort = scSeries._sort;
		displayProperties = new SeriesDisplayProperties(scSeries.displayProperties);
		depVar = new Series_Var(scSeries.depVar);
		indVar = new Series_Var(scSeries.indVar);
	}

	public override void EstablishParentChildRelationship()
	{
		SetParentAndChildRelation(DisplayProperties, this);
		SetParentAndChildRelation(IndVar, this);
		SetParentAndChildRelation(DepVar, this);
	}
}
