public void SelectAllInBaseEdge() { TurnOffSelectedItemsUpdate = true; IVertex selectedEdges = Vertex.Get("SelectedEdges:"); if (selectedEdges is VertexBase) { ((VertexBase)selectedEdges).CanFireChangeEvent = false; } foreach (IEdge ee in Vertex.Get(@"BaseEdge:\To:")) { Edge.AddEdge(selectedEdges, ee); } if (selectedEdges is VertexBase) { ((VertexBase)selectedEdges).CanFireChangeEvent = true; } TurnOffSelectedItemsUpdate = false; foreach (TreeViewItem i in Items) { if (i is TreeVisualiserViewItem) { TreeVisualiserViewItem ii = (TreeVisualiserViewItem)i; ii.IsSelected = true; } } }
public void UpdateSelectedVertexes(bool IsCtrl, TreeVisualiserViewItem item) { if (TurnOffSelectedVertexesUpdate) { return; } TurnOffSelectedItemsUpdate = true; IVertex sv = Vertex.Get("SelectedEdges:"); IEdge e = (IEdge)item.Tag; if (!IsCtrl) { GraphUtil.RemoveAllEdges(sv); } if (item.IsSelected) { Edge.AddEdge(sv, e); } else { Edge.DeleteVertexByEdgeOnlyToVertex(sv, e); } // LEGACY // // currently there is no support for same vertex in two places in tree begin selected / unselected // this is due to performance // /*IVertex sv = Vertex.Get("SelectedVertexes:"); * * GraphUtil.RemoveAllEdges(sv); * * foreach (TreeViewItem i in Items) * UpdateSelectedVertexes_Reccurent(i, sv); */ TurnOffSelectedItemsUpdate = false; }
private void SelectedVertexesUpdated_Reccurent(TreeViewItem i, IVertex sv) { if (i is TreeVisualiserViewItem) { TreeVisualiserViewItem ii = (TreeVisualiserViewItem)i; if (Edge.FindEdgeByEdgeOnlyToVertex(sv, (IEdge)ii.Tag) != null) { ii.IsSelected = true; } else { ii.IsSelected = false; } } foreach (TreeViewItem ii in i.Items) { SelectedVertexesUpdated_Reccurent(ii, sv); } }
public TreeViewItem GetTreeViewItem(IEdge e, bool generateDeeperLevel) { TreeVisualiserViewItem i = new TreeVisualiserViewItem(); i.TreeParent = this; i.Tag = e; i.UpdateHeader(); TurnOffSelectedVertexesUpdate = true; IVertex sv = Vertex.Get("SelectedEdges:"); if (Edge.FindEdgeByEdge(sv, e) != null) { i.IsSelected = true; } TurnOffSelectedVertexesUpdate = false; if (generateDeeperLevel) { if (e.To.Count() > 0) { TreeViewItem tvi = new TreeViewItem(); i.Items.Add(tvi); } } e.To.Change += i.VertexChange; return(i); }