void Tree_OnVertexAdded(object sender, VerticesModifiedEventArgs e) { if(e.Status == ModificationStatus.Successful) { this.VertexWrappers.Remove(this.VertexWrappers.Last()); this.VertexWrappers.Add(new MarkingTreeNodeWrapper(this, e.Vertex as MarkingTreeNode)); } }
void graph_OnVertexAdded(object sender, VerticesModifiedEventArgs e) { if (e.Status == ModificationStatus.Successful) { Random r = new Random(); WFVertexWrapper last = VertexWrappers.Last() as WFVertexWrapper; if (e.Vertex is MarkedPlace) { VertexWrappers.Add(new MarkedPlaceWrapper(this, e.Vertex as MarkedPlace) { Coords = last.Coords, SizeF = last.SizeF }); VertexWrappers.Remove(last); } if (e.Vertex is Transition) { (last as TransitionWrapper).Angle = r.Next(360); } } }
void graph_OnVertexRemoved(object sender, VerticesModifiedEventArgs e) { if (e.Status == ModificationStatus.Successful) { firstPart.Remove(e.Vertex); secondPart.Remove(e.Vertex); } }
void graph_OnVertexAdded(object sender, VerticesModifiedEventArgs e) { if (e.Status == ModificationStatus.Successful) { if (addToSecond) secondPart.Add(e.Vertex); else firstPart.Add(e.Vertex); } }
void sGraph_OnVertexAdded(object sender, VerticesModifiedEventArgs e) { if (e.Status == ModificationStatus.Successful) { var last = this.VertexWrappers.Last(); this.VertexWrappers.Remove(last); this.VertexWrappers.Add(new ConceptVertexWrapper(this, e.Vertex as ConceptVertex) { Coords = this.currentCoords }); } }
void tree_OnVertexAdded(object sender, VerticesModifiedEventArgs e) { if (e.Status == ModificationStatus.Successful) { if(!(e.Vertex as MarkingTreeNode).IsRoot()) (e.Vertex as MarkingTreeNode).RecalculateMarking(); } }
void graph_OnVertexRemoved(object sender, VerticesModifiedEventArgs e) { if (e.Status == ModificationStatus.Successful) { VertexWrappers.RemoveAll(v => v.EqualsVetices(e.Vertex)); } }
void graph_OnVertexAdded(object sender, VerticesModifiedEventArgs e) { if (e.Status == ModificationStatus.Successful) { VertexWrappers.Add(new WFVertexWrapper(this, e.Vertex) { Size = DefaultVertexSize, Center = currentCoords }); } if (e.Status == ModificationStatus.AlreadyExist) { this.counter++; } }
void Tree_OnVertexAdded(object sender, VerticesModifiedEventArgs e) { if (e.Status == ModificationStatus.Successful) { var last = this.VertexWrappers.Last(); this.VertexWrappers.Remove(last); this.VertexWrappers.Add(new TreeNodeWrapper(this, e.Vertex as TreeGraphNode)); } }
private void Graph_OnVertexAdded(object sender, VerticesModifiedEventArgs e) { if (e.Status == ModificationStatus.Successful) { WFVertexWrapper last = VertexWrappers.Last() as WFVertexWrapper; if (e.Vertex is ColouredTransition) { VertexWrappers.Add(new ColouredTransitionWrapper(this, e.Vertex as ColouredTransition) { Coords = last.Coords, SizeF = DefaultTransitionSize }); } if (e.Vertex is ColouredPlace) { VertexWrappers.Add(new ColouredPlaceWrapper(this, e.Vertex as ColouredPlace) { Coords = last.Coords, SizeF = DefaultPlaceSize }); } VertexWrappers.Remove(last); } }
void graph_OnAddVertex(object sender, VerticesModifiedEventArgs e) { if (e.Status == ModificationStatus.Successful) { // check exists ids if (this.GetVertices(v => (v as ConceptVertex).Id == this._currentId).Count != 0) { e.Status = ModificationStatus.AlreadyExist; return; } } }
public void RemoveVertex(object vertexValue) { ModificationStatus status = vertices.Exists(v => v.Value.Equals(vertexValue)) ? ModificationStatus.Successful : ModificationStatus.NotExist; VerticesModifiedEventArgs e = new VerticesModifiedEventArgs(status, this[vertexValue],vertexValue); if (OnRemoveVertex != null) OnRemoveVertex(this, e); if (e.Status == ModificationStatus.Successful) { RemoveEdges(e.Vertex.Value); vertices.Remove(e.Vertex as Vertex); } if (OnVertexRemoved != null) OnVertexRemoved(this, e); }
public void AddVertex(object vertexValue) { ModificationStatus status = !vertices.Exists(v => v.Value.Equals(vertexValue)) ? ModificationStatus.Successful : ModificationStatus.AlreadyExist; VerticesModifiedEventArgs e = new VerticesModifiedEventArgs(status, this.CreateVertex(vertexValue),vertexValue); if (OnAddVertex != null) OnAddVertex(this, e); if (e.Status == ModificationStatus.Successful) vertices.Add(e.Vertex); if (OnVertexAdded != null) OnVertexAdded(this, e); }