public void Do() { //If you are modifying the next of an item... if (this.nextEnable) { if (this.presentConnector.Parent is GraphConditional) { this.conditionalOut = ((GraphConditional)this.presentConnector.Parent).GetPredefOut(this.presentConnector); if ((conditionalOut == ConditionalOut.True) && (((GraphConditional)this.presentConnector.Parent).NextTrue != null)) { if (DialogResult.Yes != MowayMessageBox.Show(InsertArrowMessages.REPLACE_TRUE + "\r\n" + InsertArrowMessages.CONTINUE, InsertArrowMessages.INSERT_ARROW, MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) { this.Cancel(); return; } else if ((conditionalOut == ConditionalOut.False) && (((GraphConditional)this.presentConnector.Parent).NextFalse != null)) { if (DialogResult.Yes != MowayMessageBox.Show(InsertArrowMessages.REPLACE_FALSE + "\r\n" + InsertArrowMessages.CONTINUE, InsertArrowMessages.INSERT_ARROW, MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) { this.Cancel(); return; } } } } GraphDiagram.DeleteElement(diagramLayer, diagram, this.graphArrowToDelete); this.graphArrow = GraphDiagram.InsertArrow(this.diagram, this.diagramLayer, this.presentConnector, this.fixedConnector, this.conditionalOut, this.gridStatus); } else //If you are modifying an item's prev { if (fixedConnector.Parent is GraphConditional) { if (((GraphConditional)fixedConnector.Parent).NextTrue == this.graphArrowToDelete) { this.conditionalOut = ConditionalOut.True; } else { this.conditionalOut = ConditionalOut.False; } } GraphDiagram.DeleteElement(this.diagramLayer, this.diagram, this.graphArrowToDelete); this.graphArrow = GraphDiagram.InsertArrow(this.diagram, this.diagramLayer, this.fixedConnector, this.presentConnector, this.conditionalOut, this.gridStatus); } foreach (GraphElement element in this.tempLayer.Elements) { element.DisableConnectors(); } this.tempLayer.ClearAndHide(); this.diagramLayer.UpdateSurface(); if (this.OperationFinished != null) { this.OperationFinished(this, new OperationEventArgs(Operation.Reconnect)); } }