Interfaces Equals operator and updating the networkCard equals operator to use the interfaces operator.
This commit is contained in:
parent
485a57382b
commit
990920b48f
@ -103,6 +103,9 @@ namespace EduNetworkBuilder
|
|||||||
if (MAC != compareWith.MAC) return false;
|
if (MAC != compareWith.MAC) return false;
|
||||||
|
|
||||||
//List<NetworkInterface> interfaces = new List<NetworkInterface>();
|
//List<NetworkInterface> interfaces = new List<NetworkInterface>();
|
||||||
|
if (interfaces.Count != compareWith.interfaces.Count) return false;
|
||||||
|
for (int i = 0; i < interfaces.Count; i++)
|
||||||
|
if (!interfaces[i].Equals(compareWith.interfaces[i])) return false;
|
||||||
if (UsesDHCP != compareWith.UsesDHCP) return false;
|
if (UsesDHCP != compareWith.UsesDHCP) return false;
|
||||||
if (CanUseDHCP != compareWith.CanUseDHCP) return false;
|
if (CanUseDHCP != compareWith.CanUseDHCP) return false;
|
||||||
if (MustUseDHCP != compareWith.MustUseDHCP) return false;
|
if (MustUseDHCP != compareWith.MustUseDHCP) return false;
|
||||||
|
@ -66,6 +66,17 @@ namespace EduNetworkBuilder
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool Equals(NetworkInterface CompareWith)
|
||||||
|
{
|
||||||
|
if (!myIP.Equals(CompareWith.myIP)) return false;
|
||||||
|
if (nic_name != CompareWith.nic_name) return false;
|
||||||
|
if (!AttachedToHostNic.Equals(CompareWith.AttachedToHostNic)) return false;
|
||||||
|
if (VLANs.Count != CompareWith.VLANs.Count) return false;
|
||||||
|
for (int i = 0; i < VLANs.Count; i++)
|
||||||
|
if (!VLANs[i].Equals(CompareWith.VLANs[i])) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public VLANTagType GetVLANTag(int id)
|
public VLANTagType GetVLANTag(int id)
|
||||||
{
|
{
|
||||||
VLANInfo vli = GetVLANInfo(id);
|
VLANInfo vli = GetVLANInfo(id);
|
||||||
|
Loading…
Reference in New Issue
Block a user