diff --git a/EduNetworkBuilder/DeviceConfig.cs b/EduNetworkBuilder/DeviceConfig.cs
index 41ce703..7f632df 100644
--- a/EduNetworkBuilder/DeviceConfig.cs
+++ b/EduNetworkBuilder/DeviceConfig.cs
@@ -302,7 +302,7 @@ namespace EduNetworkBuilder
private void btnNicEdit_Click(object sender, EventArgs e)
{
//open a window to change the settings on the nic
- if (ClonedItem.GetType().ToString() == "EduNetworkBuilder.NetworkDevice")
+ if (NB.GetComponentType(ClonedItem) == GeneralComponentType.device)
{
NetworkDevice ndCLonedItem = (NetworkDevice)ClonedItem;
ndCLonedItem.EditNic(lbNics.SelectedIndex +1); //Skip the loopback nic
@@ -396,12 +396,7 @@ namespace EduNetworkBuilder
private void lbNics_DoubleClick(object sender, EventArgs e)
{
- if (NB.GetComponentType(ClonedItem) == GeneralComponentType.device)
- {
- NetworkDevice nd = (NetworkDevice)ClonedItem;
- nd.EditNic(lbNics.SelectedIndex + 1); //skip the loopback device
- UpdateForm();
- }
+ btnNicEdit_Click(sender,e); //We want this code in just one location
}
private void btnGateway_Click(object sender, EventArgs e)
diff --git a/EduNetworkBuilder/NetworkCardEditor.cs b/EduNetworkBuilder/NetworkCardEditor.cs
index c71f848..bc7b5ca 100644
--- a/EduNetworkBuilder/NetworkCardEditor.cs
+++ b/EduNetworkBuilder/NetworkCardEditor.cs
@@ -176,6 +176,10 @@ namespace EduNetworkBuilder
{
MyNicToEdit.EncryptionKey = tbVPNEncrypt.Text;
}
+ if(tbSSID != null)
+ {
+ MyNicToEdit.SSID = tbSSID.Text;
+ }
Close();
}
diff --git a/EduNetworkBuilder/NetworkDevice.cs b/EduNetworkBuilder/NetworkDevice.cs
index eb67b37..e1721fb 100644
--- a/EduNetworkBuilder/NetworkDevice.cs
+++ b/EduNetworkBuilder/NetworkDevice.cs
@@ -619,11 +619,33 @@ namespace EduNetworkBuilder
nic.EditInterface(ifIndex);
}
}
+
+ ///
+ /// Duplicate the ssid and key to all NICs of identical type on this device
+ ///
+ /// The ssid to set everything to
+ /// the Key to set everything to
+ /// the type of nic (must be a wireless type)
+ private void duplicateSSIDnKey(string SSID, string Key, NicType NType)
+ {
+ if (NType != NicType.wport && NType != NicType.wlan) return; // Not a wireless port. Do nothing.
+ foreach(NetworkCard NC in NICs)
+ {
+ if(NC.GetNicType == NType)
+ {
+ NC.SSID = SSID;
+ NC.WirelessKey = Key;
+ }
+ }
+ }
public void EditNic(int index)
{
if (index < 0) return;
if (index > NICs.Count) return;
NICs[index].Edit();
+ //If the nic was a wireless, make sure we copy the ssid and key to all other of identical type
+ if (NICs[index].GetNicType == NicType.wport || NICs[index].GetNicType == NicType.wlan)
+ duplicateSSIDnKey(NICs[index].SSID, NICs[index].WirelessKey, NICs[index].GetNicType);
}
public void DeleteNic(int index)
{