equals func on net links

This commit is contained in:
Tim Young 2018-03-16 16:27:27 -05:00
parent 9fd7c6a119
commit b4db7cf99c
1 changed files with 17 additions and 0 deletions

View File

@ -87,6 +87,23 @@ namespace EduNetworkBuilder
SrcNic = src;
DstNic = dst;
}
public override bool Equals(NetworkComponent toCompare)
{
if (!(toCompare is NetworkLink)) return false; //comparing a link to a device
NetworkLink CompareLink = (NetworkLink)toCompare;
if (!SrcNic.Equals(CompareLink.SrcNic)) return false;
if (!DstNic.Equals(CompareLink.DstNic)) return false;
if (theLinkType != CompareLink.theLinkType) return false;
if (isInvisible != CompareLink.isInvisible) return false;
if (IsDirty != CompareLink.IsDirty) return false;
if (UniqueIdentifier != CompareLink.UniqueIdentifier) return false;
if (hostname != CompareLink.hostname) return false;
if (isInvisible != CompareLink.isInvisible) return false;
return true;
}
public override void Load(XmlNode theNode)
{
foreach (XmlNode Individual in theNode.ChildNodes)