remove all the wireless connections on network load. They will be rebuilt.

This commit is contained in:
Tim Young 2018-04-10 09:03:29 +03:00
parent eb2dfde694
commit aa24aba3a9
1 changed files with 22 additions and 2 deletions

View File

@ -326,8 +326,7 @@ namespace EduNetworkBuilder
break;
case "link":
newNL = new NetworkLink(Individual);
if(newNL.theLinkType != LinkType.wireless)
NetComponents.Add(newNL); //do no load wireless links. Rebuild them
NetComponents.Add(newNL);
break;
case "device":
newND = new NetworkDevice(Individual);
@ -404,6 +403,7 @@ namespace EduNetworkBuilder
}
}
}
DoAllRemoveAllWirelessLinks(); //remove all wireless links. They will be rebuilt below
DoAllVerifyLinks();
DoAllAutoJoin();
OpenHelpIfNeeded(skipOpeningWindows);
@ -2118,6 +2118,26 @@ namespace EduNetworkBuilder
return didanything;
}
public bool DoAllRemoveAllWirelessLinks()
{
NetworkLink nl;
bool didanything = false;
NetworkComponent nc;
for (int i = NetComponents.Count - 1; i >= 0; i--)
{
nc = NetComponents[i];
if (nc is NetworkLink)
{
nl = (NetworkLink)nc;
if(nl.theLinkType == LinkType.wireless)
{
didanything = true;
nl.Destroy(); //We will rebuild it later
}
}
}
return didanything;
}
public bool DoAllMarkAsLinked()
{
bool didanything = false;