105 lines
2.2 KiB
C#
105 lines
2.2 KiB
C#
using System.Xml.Serialization;
|
|
|
|
namespace ShrlAlgoToolkit.RevitAddins.RvIndependent.MetroGauges.LandXMLData
|
|
{
|
|
[XmlType("CgPoints")]
|
|
[Serializable]
|
|
public class CgPoints
|
|
{
|
|
public CgPoints()
|
|
{
|
|
cgPoints = new List<CgPoint>();
|
|
}
|
|
|
|
[XmlIgnore]
|
|
public CgPoint this[int index]
|
|
{
|
|
get
|
|
{
|
|
if (index < cgPoints.Count)
|
|
{
|
|
return cgPoints[index];
|
|
}
|
|
|
|
throw new IndexOutOfRangeException();
|
|
}
|
|
set
|
|
{
|
|
if (index < cgPoints.Count)
|
|
{
|
|
cgPoints[index] = value;
|
|
return;
|
|
}
|
|
|
|
if (index == cgPoints.Count)
|
|
{
|
|
cgPoints.Add(value);
|
|
return;
|
|
}
|
|
|
|
throw new IndexOutOfRangeException();
|
|
}
|
|
}
|
|
|
|
[XmlIgnore]
|
|
public int Count => cgPoints.Count;
|
|
|
|
[XmlIgnore]
|
|
public bool IsReadOnly => false;
|
|
|
|
[XmlElement("CgPoint")]
|
|
public List<CgPoint> cgPoints { get; set; }
|
|
|
|
[XmlAttribute("name")]
|
|
public string Name { get; set; }
|
|
|
|
[XmlAttribute("id")]
|
|
public string Id { get; set; }
|
|
|
|
public void Add(CgPoint item)
|
|
{
|
|
cgPoints.Add(item);
|
|
}
|
|
|
|
public void Clear()
|
|
{
|
|
cgPoints.Clear();
|
|
}
|
|
|
|
public bool Contains(CgPoint item)
|
|
{
|
|
return cgPoints.Contains(item);
|
|
}
|
|
|
|
public void CopyTo(CgPoint[] array, int arrayIndex)
|
|
{
|
|
cgPoints.CopyTo(array, arrayIndex);
|
|
}
|
|
|
|
public IEnumerator<CgPoint> GetEnumerator()
|
|
{
|
|
return cgPoints.GetEnumerator();
|
|
}
|
|
|
|
public int IndexOf(CgPoint item)
|
|
{
|
|
return cgPoints.IndexOf(item);
|
|
}
|
|
|
|
public void Insert(int index, CgPoint item)
|
|
{
|
|
cgPoints.Insert(index, item);
|
|
}
|
|
|
|
public bool Remove(CgPoint item)
|
|
{
|
|
return cgPoints.Remove(item);
|
|
}
|
|
|
|
public void RemoveAt(int index)
|
|
{
|
|
cgPoints.RemoveAt(index);
|
|
}
|
|
}
|
|
}
|