整理代码

This commit is contained in:
GG Z
2025-04-24 20:56:10 +08:00
parent 4d798e5d99
commit 155cef46f8
532 changed files with 1018 additions and 854 deletions

View File

@@ -0,0 +1,104 @@
using System.Xml.Serialization;
namespace ShrlAlgo.RvKits.RvIndependent.MetroGauges.LandXMLData
{
[XmlType("Profile")]
[Serializable]
public class Profile
{
public Profile()
{
ProfileCurve = new List<ProfAlign>();
ProfileSurfaces = new List<ProfileSurface>();
}
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<ProfileSurface> ProfileSurfaces { get; set; }
[XmlElement("ProfAlign")]
public List<ProfAlign> 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<ProfAlign> 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);
}
}
}