Process for connecting a network link to the device it is connected to. Without this, cloned networks fail.

This commit is contained in:
Tim Young 2017-08-03 11:36:53 -05:00
parent ff37a1b0ef
commit 4c921ab280
2 changed files with 27 additions and 0 deletions

View File

@ -1556,6 +1556,23 @@ namespace EduNetworkBuilder
return didanything;
}
public bool DoAllMarkAsLinked()
{
bool didanything = false;
NetworkLink nl;
foreach (NetworkComponent nc in NetComponents.ToList())
{
if (NB.GetComponentType(nc) == GeneralComponentType.link)
{
nl = (NetworkLink)nc;
nl.MarkAsLinked();
didanything = true;
}
}
return didanything;
}
public bool DoAllAutoJoin()
{
bool didanything = false;

View File

@ -118,6 +118,16 @@ namespace EduNetworkBuilder
myNet.MarkAsLinked(DstNic, GetUniqueIdentifier);
}
public void MarkAsLinked()
{
Network myNet = NB.GetNetwork();
if (myNet != null)
{
myNet.MarkAsLinked(SrcNic, GetUniqueIdentifier);
myNet.MarkAsLinked(DstNic, GetUniqueIdentifier);
}
}
public override void Save(XmlWriter writer)
{
writer.WriteStartElement("link");