protected IVertex GetVertexByLocation_Reccurent(ItemCollection items, Point p) { foreach (TreeViewItem i in items) { if (VisualTreeHelper.HitTest(i, TranslatePoint(p, i)) != null) { IVertex v = MinusZero.Instance.CreateTempVertex(); Edge.AddEdgeEdges(v, (IEdge)i.Tag); vertexByLocationToReturn = v; } GetVertexByLocation_Reccurent(i.Items, p); } return(null); }
protected override void OnClick() { FormVisualiser v = (FormVisualiser)UIWpf.getParentFormVisualiser(this); if (v != null) { Edge.ReplaceEdgeEdges(v.Vertex.Get("BaseEdge:"), BaseEdge); } else { IVertex v2 = MinusZero.Instance.CreateTempVertex(); Edge.AddEdgeEdges(v2, BaseEdge); //BaseCommands.Open(v2,null); // want Form Visuliser always BaseCommands.OpenFormVisualiser(v2); } }
public IVertex GetEdgeByLocation(Point point) { var headersPresenter = UIWpf.FindVisualChild <DataGridColumnHeadersPresenter>(ThisDataGrid); double headerActualHeight = headersPresenter.ActualHeight; if (point.Y <= headerActualHeight) // if header { return(null); } foreach (var item in ThisDataGrid.Items) { var row = ThisDataGrid.ItemContainerGenerator.ContainerFromItem(item) as DataGridRow; if (row != null) { DataGridRow roww = (DataGridRow)row; if (VisualTreeHelper.HitTest(roww, TranslatePoint(point, roww)) != null) { if (point.X >= ThisDataGrid.Columns.First().ActualWidth&& roww.IsEditing) { return(null); } IVertex v = MinusZero.Instance.CreateTempVertex(); Edge.AddEdgeEdges(v, (IEdge)roww.Item); return(v); } } } // DO WANT THIS FEATURE ? // if (GeneralUtil.CompareStrings(MinusZero.Instance.Root.Get(@"User\CurrentUser:\Settings:\AllowBlankAreaDragAndDrop:").Value, "StartAndEnd")) { return(Vertex.Get("BaseEdge:")); } else { return(null); } }
protected override void UpdateBaseEdge() { IVertex bas = Vertex.Get(@"BaseEdge:\To:"); if (bas != null) { ToShowEdgesMeta = null; if (Vertex.Get(@"ToShowEdgesMeta:\Meta:") != null) { ToShowEdgesMeta = Vertex.Get(@"ToShowEdgesMeta:\Meta:"); } if (ToShowEdgesMeta == null) // take first edge from BaseEdge\To, to have Meta as ToShowEdesMeta:\Meta:==null { IEdge e = bas.FirstOrDefault(); if (e != null) { ToShowEdgesMeta = e.Meta; VertexChangeListenOff(); Edge.AddEdgeEdges(Vertex.Get(@"ToShowEdgesMeta:"), e); VertexChangeListenOn(); } } if (ToShowEdgesMeta != null) { ((EasyVertex)Vertex.Get(@"FilterQuery:")).CanFireChangeEvent = false; Vertex.Get(@"FilterQuery:").Value = ToShowEdgesMeta.Value + ":"; ((EasyVertex)Vertex.Get(@"FilterQuery:")).CanFireChangeEvent = true; } if (Vertex.Get(@"FilterQuery:") != null && Vertex.Get(@"FilterQuery:").Value != null) // do the filtering { IVertex data = VertexOperations.DoFilter(bas, Vertex.Get(@"FilterQuery:")); if (data != null) { ThisDataGrid.ItemsSource = data.ToList(); } else { ThisDataGrid.ItemsSource = null; } } else { ThisDataGrid.ItemsSource = bas.ToList(); // if there is no .ToList DataGrid can not edit } if (GraphUtil.GetValueAndCompareStrings(Vertex.Get("ExpertMode:"), "True")) { ExpertMode = true; } else { ExpertMode = false; } ResetView(); } }