diff --git a/EduNetworkBuilder/NetShape.cs b/EduNetworkBuilder/NetShape.cs index 171512f..ef907e4 100644 --- a/EduNetworkBuilder/NetShape.cs +++ b/EduNetworkBuilder/NetShape.cs @@ -17,6 +17,7 @@ namespace EduNetworkBuilder public Rectangle InArea; public Color LineColor = Color.Empty; public Color FillColor = Color.Empty; + public string Name = ""; int DragSize = 15; public NetShape(NetShapeType What, Rectangle Where, Color fillcolor, Color linecolor) @@ -136,7 +137,7 @@ namespace EduNetworkBuilder public override string ToString() { - string answer = MyShape.ToString() + " " + LineColor.Name + "/" + FillColor.Name; + string answer = Name + " " + MyShape.ToString() + " " + LineColor.Name + "/" + FillColor.Name; answer = answer + " X:" + InArea.X + " Y:" + InArea.Y; answer = answer + "W:" + InArea.Width + " H:" + InArea.Height; return answer; @@ -151,6 +152,9 @@ namespace EduNetworkBuilder { switch (Individual.Name.ToLower()) { + case "name": + Name = Individual.InnerText; + break; case "what": MyShape = NB.TryParseEnum(Individual.InnerText, NetShapeType.none); break; @@ -172,6 +176,7 @@ namespace EduNetworkBuilder public void Save(XmlWriter writer) { writer.WriteStartElement("shape"); + writer.WriteElementString("name", Name); writer.WriteElementString("what", MyShape.ToString()); RectangleConverter converter = new RectangleConverter(); writer.WriteElementString("where", converter.ConvertToString(InArea));