/// <summary> /// Insert a Edge into the graph /// </summary> /// <param name="e">the Edge</param> /// <returns>status</returns> private bool AddEdge(Edge e) { if (GetModel.ContainsEdges(e.Id)) { return(false); } GetModel.AddEdge(e); GetModel.GetVertex(e.FromId).EdgesId.Add(e.Id); GetModel.GetVertex(e.ToId).EdgesId.Add(e.Id); AddedEdge?.Invoke(e); return(true); }
public void ChangePosition(Point p) { SelectedElements.ForEach(v => { if (!GetModel.ContainsVerticies(v)) { return; } var vc = GetModel.GetVertex(v); vc.PositionX = p.X; vc.PositionY = p.Y; }); Changed = true; }