network loads and saves NetShapes

This commit is contained in:
Tim Young 2018-02-24 17:30:13 -06:00
parent e9fe9095b6
commit 3b0bb6358f
2 changed files with 13 additions and 0 deletions

View File

@ -23,6 +23,10 @@ namespace EduNetworkBuilder
InArea = Where; InArea = Where;
WhatColor = color; WhatColor = color;
} }
public NetShape(XmlNode what)
{
Load(what);
}
/// <summary> /// <summary>
/// Draw the specified shape on the image /// Draw the specified shape on the image

View File

@ -68,6 +68,7 @@ namespace EduNetworkBuilder
private List<Image> PacketImages = new List<Image>(); private List<Image> PacketImages = new List<Image>();
private List<PingTestStatus> PingTestStats = new List<PingTestStatus>(); private List<PingTestStatus> PingTestStats = new List<PingTestStatus>();
private List<string> BrokenItems = new List<string>(); private List<string> BrokenItems = new List<string>();
private List<NetShape> Shapes = new List<NetShape>(); //For storing simple shapes which are drawn on the network
public bool IsRandomNetwork = false; public bool IsRandomNetwork = false;
private List<AnimationClass> Animations = new List<AnimationClass>(); private List<AnimationClass> Animations = new List<AnimationClass>();
@ -271,6 +272,10 @@ namespace EduNetworkBuilder
StartingHelpLevel = NB.ParseEnum<NetTestVerbosity>(Individual.InnerText); StartingHelpLevel = NB.ParseEnum<NetTestVerbosity>(Individual.InnerText);
HintsToDisplay = StartingHelpLevel; HintsToDisplay = StartingHelpLevel;
break; break;
case "shape":
NetShape nShape = new NetShape(Individual);
Shapes.Add(nShape);
break;
case "vlanname": case "vlanname":
if (Individual.Attributes != null && Individual.Attributes["ID"] != null) if (Individual.Attributes != null && Individual.Attributes["ID"] != null)
{ {
@ -418,6 +423,10 @@ namespace EduNetworkBuilder
{ {
writer.WriteElementString("tag",HT.ToString()); writer.WriteElementString("tag",HT.ToString());
} }
foreach(NetShape shape in Shapes)
{
shape.Save(writer);
}
foreach(VLANName VLAN in VlanNames) foreach(VLANName VLAN in VlanNames)
{ {
writer.WriteStartElement("VLANName"); writer.WriteStartElement("VLANName");