Do delete device using DoActions
This commit is contained in:
@ -1354,18 +1354,19 @@ namespace EduNetworkBuilder
|
||||
private void TryDeleteOneItem(NetworkDevice Item)
|
||||
{
|
||||
//Deleting the item is easy, but we also need to delete any links to that item
|
||||
List<HostNicID> NicIDs = new List<HostNicID>();
|
||||
if (Item != null)
|
||||
{
|
||||
if (myNetwork.ItemIsCritical(Item.hostname))
|
||||
return; //we cannot delete this
|
||||
NicIDs = Item.GetHostNicIDs();
|
||||
foreach (HostNicID nicID in NicIDs)
|
||||
{
|
||||
myNetwork.RemoveLinksToNic(nicID);
|
||||
}
|
||||
myNetwork.RemoveComponent(Item);
|
||||
}
|
||||
//List<HostNicID> NicIDs = new List<HostNicID>();
|
||||
//if (Item != null)
|
||||
//{
|
||||
// if (myNetwork.ItemIsCritical(Item.hostname))
|
||||
// return; //we cannot delete this
|
||||
// NicIDs = Item.GetHostNicIDs();
|
||||
// foreach (HostNicID nicID in NicIDs)
|
||||
// {
|
||||
// myNetwork.RemoveLinksToNic(nicID);
|
||||
// }
|
||||
// myNetwork.RemoveComponent(Item);
|
||||
//}
|
||||
NB.DoActionDeleteComponent(Item.GetUniqueIdentifier);
|
||||
}
|
||||
|
||||
private void pbNetworkView_DeleteShape_Click(object sender, EventArgs e)
|
||||
|
Reference in New Issue
Block a user