private void deleteNodeMenuItem_Click(object sender, RoutedEventArgs e) { if (MapControl.SelectedNodes != null && MapControl.SelectedNodes.Length <= 1) { //single node deletion if (Navigator.FocalNodeId != NodeProxy.ParentMapNodeUid) { NodeService.DeleteNodeTransclusion(Navigator.DomainId, Navigator.FocalNodeId, NodeProxy); } else { if (NodeProxy.TransclusionCount == 1) { NodeService.DeleteNode(Navigator.DomainId, NodeProxy.Id); } else { NodeService.DeleteNodePromoteTransclusion(Navigator.DomainId, Navigator.FocalNodeId, NodeProxy); } } } else { //multi node deletion if (MapControl.SelectedNodes != null) { foreach (INodeProxy nodeProxy in MapControl.SelectedNodes) { if (Navigator.FocalNodeId != nodeProxy.ParentMapNodeUid) { NodeService.DeleteNodeTransclusion(Navigator.DomainId, Navigator.FocalNodeId, nodeProxy); } else { if (nodeProxy.TransclusionCount == 1) { NodeService.DeleteNode(Navigator.DomainId, nodeProxy.Id); } else { NodeService.DeleteNodePromoteTransclusion(Navigator.DomainId, Navigator.FocalNodeId, nodeProxy); } } } } } }
public virtual void DeleteNodes(INodeProxy[] nodesToDelete) { foreach (INodeProxy nodeProxy in nodesToDelete) { if (this.FocalNodeId != nodeProxy.ParentMapNodeUid) { NodeService.DeleteNodeTransclusion(this.DomainId, this.FocalNodeId, nodeProxy); } else { if (nodeProxy.TransclusionCount == 1) { NodeService.DeleteNode(this.DomainId, nodeProxy.Id); } else { NodeService.DeleteNodePromoteTransclusion(this.DomainId, this.FocalNodeId, nodeProxy); } } } }
public async Task OnTableDelete(Node node) { NodeService.DeleteNode(Graph, node); await GraphChanged.InvokeAsync(Graph); }