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

namespace QC.CTDS.DM.DataStructures.FormatDescriptorStructure;

[Serializable]
[DataContract]
public class Axis : BindableObject, ICloneable
{
	private int _index = 1;

	private string _maxScaleRes = string.Empty;

	private string _min = string.Empty;

	private string _max = string.Empty;

	private string _step = string.Empty;

	private bool _logScale;

	private bool _revOrder;

	private int labelAngle;

	[XmlAttribute]
	[DataMember]
	[DefaultValue(0)]
	public int index
	{
		get
		{
			return _index;
		}
		set
		{
			if (_index != value)
			{
				_index = value;
				OnPropertyChanged("index");
			}
		}
	}

	[DataMember]
	[XmlIgnore]
	public string AxisType
	{
		get
		{
			if (index == 1)
			{
				return "Primary";
			}
			if (index == 2)
			{
				return "Secondary";
			}
			return "Unknown Axis";
		}
		set
		{
		}
	}

	[XmlAttribute]
	[DefaultValue("")]
	[DataMember]
	public string maxScaleRes
	{
		get
		{
			return _maxScaleRes;
		}
		set
		{
			if (!(_maxScaleRes == value))
			{
				_maxScaleRes = value;
				OnPropertyChanged("maxScaleRes");
			}
		}
	}

	[DefaultValue("")]
	[DataMember]
	[XmlAttribute]
	public string min
	{
		get
		{
			return _min;
		}
		set
		{
			if (!(_min == value))
			{
				_min = value;
				OnPropertyChanged("min");
			}
		}
	}

	[XmlAttribute]
	[DefaultValue("")]
	[DataMember]
	public string max
	{
		get
		{
			return _max;
		}
		set
		{
			if (!(_max == value))
			{
				_max = value;
				OnPropertyChanged("max");
			}
		}
	}

	[DefaultValue("")]
	[XmlAttribute]
	[DataMember]
	public string step
	{
		get
		{
			return _step;
		}
		set
		{
			if (!(_step == value))
			{
				_step = value;
				OnPropertyChanged("step");
			}
		}
	}

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

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

	[DefaultValue(0)]
	[XmlAttribute]
	[DataMember]
	public int LabelAngle
	{
		get
		{
			return labelAngle;
		}
		set
		{
			if (labelAngle != value)
			{
				labelAngle = value;
				OnPropertyChanged("LabelAngle");
			}
		}
	}

	public object Clone()
	{
		Axis axis = new Axis();
		axis.index = index;
		axis.logScale = logScale;
		axis.max = max;
		axis.min = min;
		axis.maxScaleRes = maxScaleRes;
		axis.revOrder = revOrder;
		axis.step = step;
		axis.labelAngle = labelAngle;
		return axis;
	}
}
