private void OnAddWordVertexControl(WordWrapper word) { var vertexControl = AddWordVertexControl(word); var headWordId = word.GetAttributeByName(CurrentConfiguration.Edge.SourceVertexAttributeName); var headWordVertexControl = GgArea.VertexList.Where( p => p.Key.WordWrapper.GetAttributeByName(CurrentConfiguration.Edge.TargetVertexAttributeName) .Equals(headWordId)).Select(p => p.Value).SingleOrDefault(); if (headWordVertexControl != null) { sourceVertexControl = headWordVertexControl; CreateEdgeControl(vertexControl); } DisplayGraph(); ZoomToFill(); }
private VertexControl AddWordVertexControl(WordWrapper wordWrapper) { var vertex = new WordVertex(wordWrapper, CurrentConfiguration.Vertex.LabelAttributeName); var vertexControl = new VertexControl(vertex); GgArea.AddVertexAndData(vertex, vertexControl, true); return vertexControl; }