private void SetUseActualSelection() { int index = ListBoxInterfaces.SelectedIndex; if (index < 0 || changingIf) { return; } ListBoxInterfaces.SetItemChecked(index, true); }
public void UpdateInterfaceList() { ListBoxInterfaces.Items.Clear(); ListBoxInterfaces.IsLoaded = true; var names = actProfile.GetNetworkInterfaceNames(); foreach (var name in names) { ListBoxInterfaces.Items.Add(name); ListBoxInterfaces.SetItemChecked(ListBoxInterfaces.Items.Count - 1, actProfile.IsNetworkInterfaceInProfile(name)); } if (ListBoxInterfaces.Items.Count > 0) { ListBoxInterfaces.SetSelected(0, true); } }
public void UpdateData() { foreach (string name in ListBoxInterfaces.Items) { actProfile.UseNetworkInterface(name, ListBoxInterfaces.GetItemChecked(ListBoxInterfaces.Items.IndexOf(name))); } actualSettings.IsDHCP = IPDHCPAuto.Checked; actualSettings.GateWay = IpGW.Text; actualSettings.IP = IpIpAddress.Text; actualSettings.Mask = IpMask.Text; if (DNSDHCPAuto.Checked) { actualSettings.DNS1 = null; actualSettings.DNS2 = null; actualSettings.IsDNSDHCP = true; } else { actualSettings.DNS1 = IpDNS1.Text; actualSettings.DNS2 = IpDNS2.Text; actualSettings.IsDNSDHCP = false; } }