整理代码
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ShrlAlgo.RvKits.RvIndependent.MetroGauges.LandXMLData
|
||||
{
|
||||
[XmlType("Borders")]
|
||||
[Serializable]
|
||||
public class Borders
|
||||
{
|
||||
public Borders()
|
||||
{
|
||||
Lines = new List<BorderLine>();
|
||||
}
|
||||
|
||||
public BorderLine this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (index < Lines.Count)
|
||||
{
|
||||
return Lines[index];
|
||||
}
|
||||
|
||||
throw new IndexOutOfRangeException();
|
||||
}
|
||||
set
|
||||
{
|
||||
if (index < Lines.Count)
|
||||
{
|
||||
Lines[index] = value;
|
||||
return;
|
||||
}
|
||||
|
||||
if (index == Lines.Count)
|
||||
{
|
||||
Lines.Add(value);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new IndexOutOfRangeException();
|
||||
}
|
||||
}
|
||||
|
||||
public int Count => Lines.Count;
|
||||
|
||||
public bool IsReadOnly => false;
|
||||
|
||||
[XmlElement("BorderLine")]
|
||||
public List<BorderLine> Lines { get; set; }
|
||||
|
||||
[XmlAttribute("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
public void Add(BorderLine item)
|
||||
{
|
||||
Lines.Add(item);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
Lines.Clear();
|
||||
}
|
||||
|
||||
public bool Contains(BorderLine item)
|
||||
{
|
||||
return Lines.Contains(item);
|
||||
}
|
||||
|
||||
public void CopyTo(BorderLine[] array, int arrayIndex)
|
||||
{
|
||||
Lines.CopyTo(array, arrayIndex);
|
||||
}
|
||||
|
||||
public IEnumerator<BorderLine> GetEnumerator()
|
||||
{
|
||||
return Lines.GetEnumerator();
|
||||
}
|
||||
|
||||
public int IndexOf(BorderLine item)
|
||||
{
|
||||
return Lines.IndexOf(item);
|
||||
}
|
||||
|
||||
public void Insert(int index, BorderLine item)
|
||||
{
|
||||
Lines.Insert(index, item);
|
||||
}
|
||||
|
||||
public bool Remove(BorderLine item)
|
||||
{
|
||||
return Lines.Remove(item);
|
||||
}
|
||||
|
||||
public void RemoveAt(int index)
|
||||
{
|
||||
Lines.RemoveAt(index);
|
||||
}
|
||||
|
||||
public void Transform(GeometryTransformations transformations)
|
||||
{
|
||||
foreach (BorderLine borderLine in Lines)
|
||||
{
|
||||
borderLine.Transform(transformations);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user