using System.Xml.Serialization; namespace ShrlAlgo.RvKits.RvIndependent.MetroGauges.LandXMLData { [XmlType("Profile")] [Serializable] public class Profile { public Profile() { ProfileCurve = new List(); ProfileSurfaces = new List(); } public ProfAlign this[int index] { get { if (index < ProfileCurve.Count) { return ProfileCurve[index]; } throw new IndexOutOfRangeException(); } set { if (index < ProfileCurve.Count) { ProfileCurve[index] = value; return; } if (index == ProfileCurve.Count) { ProfileCurve.Add(value); return; } throw new IndexOutOfRangeException(); } } [XmlIgnore] public int Count => ProfileCurve.Count; [XmlIgnore] public bool IsReadOnly => false; [XmlElement("ProfSurf")] public List ProfileSurfaces { get; set; } [XmlElement("ProfAlign")] public List ProfileCurve { get; set; } [XmlAttribute("name")] public string Name { get; set; } public void Add(ProfAlign item) { ProfileCurve.Add(item); } public void Clear() { ProfileCurve.Clear(); } public bool Contains(ProfAlign item) { return ProfileCurve.Contains(item); } public void CopyTo(ProfAlign[] array, int arrayIndex) { ProfileCurve.CopyTo(array, arrayIndex); } public IEnumerator GetEnumerator() { return ProfileCurve.GetEnumerator(); } public int IndexOf(ProfAlign item) { return ProfileCurve.IndexOf(item); } public void Insert(int index, ProfAlign item) { ProfileCurve.Insert(index, item); } public bool Remove(ProfAlign item) { return ProfileCurve.Remove(item); } public void RemoveAt(int index) { ProfileCurve.RemoveAt(index); } } }