using System.Xml.Serialization; namespace ShrlAlgo.RvKits.RvIndependent.MetroGauges.LandXMLData { [XmlType("ProfAlign")] [Serializable] public class ProfAlign { public ProfAlign() { PVIs = new List(); } [XmlIgnore] public TextPoint2D this[int index] { get { if (index < PVIs.Count) { return PVIs[index]; } throw new IndexOutOfRangeException(); } set { if (index < PVIs.Count) { PVIs[index] = value; return; } if (index == PVIs.Count) { PVIs.Add(value); return; } throw new IndexOutOfRangeException(); } } [XmlIgnore] public int Count => PVIs.Count; [XmlIgnore] public bool IsReadOnly => false; [XmlAttribute("type")] public int Type { get; set; } [XmlElement("CircCurve", Type = typeof(CircCurve))] [XmlElement("UnsymParaCurve", Type = typeof(AsymCurve))] [XmlElement("PVI", Type = typeof(TextPoint2D))] [XmlElement("ParaCurve", Type = typeof(ParaCurve))] public List PVIs { get; set; } [XmlAttribute("name")] public string Name { get; set; } public void Add(TextPoint2D item) { PVIs.Add(item); } public void Clear() { PVIs.Clear(); } public bool Contains(TextPoint2D item) { return PVIs.Contains(item); } public void CopyTo(TextPoint2D[] array, int arrayIndex) { PVIs.CopyTo(array, arrayIndex); } public IEnumerator GetEnumerator() { return PVIs.GetEnumerator(); } public int IndexOf(TextPoint2D item) { return PVIs.IndexOf(item); } public void Insert(int index, TextPoint2D item) { PVIs.Insert(index, item); } public bool Remove(TextPoint2D item) { return PVIs.Remove(item); } public void RemoveAt(int index) { PVIs.RemoveAt(index); } public void Transform(GeometryTransformations transformations) { foreach (TextPoint2D textPoint2D in PVIs) { textPoint2D.Transform(transformations, true); } } } }