public void DoAction(IDrawingBoard board, IGraphEvent graphEvt) { Dictionary <string, TempNode> mapResult = PropertyResult; Dictionary <string, TempNode> .Enumerator en = mapResult.GetEnumerator(); this.mapValue["var"] = ((frmProps)props).Var; while (en.MoveNext()) { KeyValuePair <string, TempNode> val = en.Current; switch (val.Value.Status) { case 0: //unchange break; case 1: //new node { Node node = GraphContainer.Instance.CreateNode(board, graphEvt, val.Value.NodeName, val.Value.NodeText, false, true); node.NodeValue = val.Value.NodeValue; node.DocID = strDocID; Add(node); GraphContainer.Instance.Nodes[val.Value.NodeName] = node; } break; case 2: //update node Node updateNode = Find(val.Value.NodeName); if (updateNode != null) { updateNode.Text = val.Value.NodeText; updateNode.NodeValue = val.Value.NodeValue; } break; case 3: //delete node Node removeNode = Remove(val.Value.NodeName); if (removeNode != null) { //board.RemoveControl(removeNode.Label); GraphContainer.Instance.Nodes.Remove(val.Value.NodeName); GraphContainer.Instance.NodeRelationship.Remove(removeNode); removeNode.Remove(); } break; } } lblDescription.Text = ((frmProps)props).Description; graphEvt.ReDraw(); }
public void DoAction(IDrawingBoard board, IGraphEvent graphEvt) { frmProps frm = this.props as frmProps; IActivity dest = null; Dictionary <string, TempNode> mapResult = PropertyResult; Dictionary <string, IActivity> mapActivity = ActivityResult; Dictionary <string, TempNode> .Enumerator en = mapResult.GetEnumerator(); while (en.MoveNext()) { KeyValuePair <string, TempNode> val = en.Current; switch (val.Value.Status) { case 0: //unchange break; case 1: //new node { Node node = GraphContainer.Instance.CreateNode(board, graphEvt, val.Value.NodeName, val.Value.NodeText, false, true); node.DocID = strDocID; node.NodeValue = val.Value.NodeText; //board.AddControl(node.Label); Add(node); GraphContainer.Instance.Nodes[val.Value.NodeName] = node; //AdjustNodePosition(); } break; case 2: //update node break; case 3: //delete node Node removeNode = Remove(val.Value.NodeName); if (removeNode != null) { //board.RemoveControl(removeNode.Label); GraphContainer.Instance.Nodes.Remove(val.Value.NodeName); GraphContainer.Instance.NodeRelationship.Remove(removeNode); removeNode.Remove(); //AdjustNodePosition(); } break; } } graphEvt.ReDraw(); return; }
public void DoAction(IDrawingBoard board, IGraphEvent graphEvt) { frmProps frm = this.props as frmProps; IActivity dest = null; Dictionary <string, TempNode> mapResult = PropertyResult; Dictionary <string, IActivity> mapActivity = ActivityResult; Dictionary <string, TempNode> .Enumerator en = mapResult.GetEnumerator(); Dictionary <string, IActivity> .Enumerator ea = mapActivity.GetEnumerator(); if (!frm.RemoveRelationship) { while (ea.MoveNext()) { KeyValuePair <string, IActivity> pair = ea.Current; dest = pair.Value; break; } if (dest != null) { Node n1 = this.primaryNode; Node n2 = dest.EntryNode; n1.LineNode = new Point(0, 0); n2.LineNode = new Point(0, 0); GraphContainer.Instance.NodeRelationship[n1] = n2; n1.Text = n2.Text; } } else { Node n1 = this.primaryNode; GraphContainer.Instance.NodeRelationship.Remove(n1); n1.Text = ""; } while (en.MoveNext()) { KeyValuePair <string, TempNode> val = en.Current; if (val.Value.NodeName != primaryNode.NodeName) { switch (val.Value.Status) { case 0: //unchange break; case 1: //new node { Node node = GraphContainer.Instance.CreateNode(board, graphEvt, val.Value.NodeName, val.Value.NodeText, false, true); node.DocID = strDocID; node.NodeValue = val.Value.NodeText; //board.AddControl(node.Label); Add(node); GraphContainer.Instance.Nodes[val.Value.NodeName] = node; //AdjustNodePosition(); } break; case 2: //update node break; case 3: //delete node Node removeNode = Remove(val.Value.NodeName); if (removeNode != null) { //board.RemoveControl(removeNode.Label); GraphContainer.Instance.Nodes.Remove(val.Value.NodeName); GraphContainer.Instance.NodeRelationship.Remove(removeNode); removeNode.Remove(); //AdjustNodePosition(); } break; } } } lblDescription.Text = ((frmProps)props).Description; this.mapValue["arguments"] = ((frmProps)props).Arguments; graphEvt.ReDraw(); }
public void DoAction(IDrawingBoard board, IGraphEvent graphEvt) { Dictionary <string, TempNode> mapResult = PropertyResult; Dictionary <string, TempNode> .Enumerator en = mapResult.GetEnumerator(); while (en.MoveNext()) { KeyValuePair <string, TempNode> val = en.Current; switch (val.Value.Status) { case 0: //unchange break; case 1: //new node { Node node = GraphContainer.Instance.CreateNode(board, graphEvt, val.Value.NodeName, val.Value.NodeText, false, true); node.NodeValue = val.Value.NodeValue; node.DocID = strDocID; //board.AddControl(node.Label); Add(node); GraphContainer.Instance.Nodes[val.Value.NodeName] = node; //AdjustNodePosition(); } break; case 2: //update node Node updateNode = Find(val.Value.NodeName); if (updateNode != null) { updateNode.Text = val.Value.NodeText; updateNode.NodeValue = val.Value.NodeValue; } break; case 3: //delete node Node removeNode = Remove(val.Value.NodeName); if (removeNode != null) { //board.RemoveControl(removeNode.Label); GraphContainer.Instance.Nodes.Remove(val.Value.NodeName); GraphContainer.Instance.NodeRelationship.Remove(removeNode); removeNode.Remove(); //AdjustNodePosition(); } break; } } lblDescription.Text = ((frmProps)props).Description; this.mapValue["maxdigit"] = Convert.ToString(((frmProps)props).MaxDigit); this.mapValue["retry"] = Convert.ToString(((frmProps)props).MaxRetry); this.mapValue["silent"] = Convert.ToString(((frmProps)props).MaxSilent); this.mapValue["entrymsg"] = ((frmProps)props).EntryMessage; this.mapValue["invalidmsg"] = ((frmProps)props).InvalidMessage; this.mapValue["noinputmsg"] = ((frmProps)props).NoInputMessage; this.mapValue["globaltimeout"] = ((frmProps)props).GlobalTimeout; this.mapValue["globalinvalid"] = ((frmProps)props).GlobalInvalid; graphEvt.ReDraw(); }