// Get the selected PIF. // Return null for single-host internal network, or a new VLAN. private PIF GetSelectedPIF() { // If we are on a physical network we don't look at the VLAN combo box, as it is obv not used PIF p = GetNetworksPIF(); if (p != null && p.physical) { return(p); } if (p != null && p.IsBondNIC()) { return(p); } // also no need to look in the combo box if we're a CHIN as they can't be edited either if (p != null && p.IsTunnelAccessPIF()) { return(p); } p = NICNameToVirtualPIF((string)HostPNICList.SelectedItem, (long)numUpDownVLAN.Value); // this is either now null (on an internal network or a new VLAN) or a non phys pif representing a vlan (external network) return(p); }
private void DeleteBondButton_Click(object sender, EventArgs e) { PIF pif = ((PIFRow)dataGridView1.SelectedRows[0]).Pif; System.Diagnostics.Trace.Assert(pif.IsBondNIC()); XenAPI.Network network = pif.Connection.Resolve(pif.network); var destroyBondCommand = new DestroyBondCommand(Program.MainWindow, network); destroyBondCommand.Execute(); }