Files
ShrlAlgoToolkit/ShrlAlgoToolkit.RevitAddins/RvIndependent/MetroGauges/LandXMLData/Profile.cs

105 lines
2.4 KiB
C#
Raw Normal View History

using System.Xml.Serialization;
2025-04-24 20:56:44 +08:00
namespace ShrlAlgoToolkit.RevitAddins.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);
}
}
}