示例#1
0
 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);
                     }
                 }
             }
         }
     }
 }
示例#2
0
 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);
             }
         }
     }
 }
示例#3
0
 public async Task OnTableDelete(Node node)
 {
     NodeService.DeleteNode(Graph, node);
     await GraphChanged.InvokeAsync(Graph);
 }