Пример #1
0
        public void DoAction(IDrawingBoard board, IGraphEvent graphEvt)
        {
            frmProps frm = this.props as frmProps;

            this.ActivityValue  = frm.PropertyResult;
            lblDescription.Text = frm.Description;
        }
        public DialogResult ShowProperties()
        {
            DialogResult result = DialogResult.Ignore;

            if (props != null)
            {
                props.Dispose();
            }

            props = null;

            props = new frmProps();

            ((frmProps)props).Activities = this;
            if (mapValue.ContainsKey("extension"))
            {
                ((frmProps)props).Extension = this.mapValue["extension"];
            }
            if (mapValue.ContainsKey("gotolabel"))
            {
                ((frmProps)props).GotoLabel = this.mapValue["gotolabel"];
            }

            result = props.ShowDialog();

            return(result);
        }
Пример #3
0
        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 DialogResult ShowProperties()
        {
            DialogResult result = DialogResult.Ignore;

            if (props != null)
            {
                props.Dispose();
            }

            props = null;
            props = new frmProps();
            ((frmProps)props).Activities = this;
            result = props.ShowDialog();
            return(result);
        }
        public void DoAction(IDrawingBoard board, IGraphEvent graphEvt)
        {
            frmProps  frm  = this.props as frmProps;
            IActivity dest = null;

            if (!frm.RemoveRelationship)
            {
                Dictionary <string, IActivity> .Enumerator ee = frm.Result.GetEnumerator();
                while (ee.MoveNext())
                {
                    KeyValuePair <string, IActivity> pair = ee.Current;
                    dest = pair.Value;
                    break;
                }

                if (dest != null)
                {
                    Node n1 = this.Nodes[0] as Node;
                    Node n2 = dest.EntryNode;
                    Node n3 = this.Nodes[1] as Node;

                    n1.LineNode = new Point(0, 0);
                    n2.LineNode = new Point(0, 0);

                    GraphContainer.Instance.NodeRelationship[n1] = n2;

                    n1.Text = n2.Text;

                    this.mapValue["extension"] = Convert.ToString(((frmProps)props).Extension);
                    this.mapValue["gotolabel"] = Convert.ToString(((frmProps)props).GotoLabel);

                    n3.Text = this.mapValue["gotolabel"];
                }
            }
            else
            {
                Node n1 = this.Nodes[0] as Node;
                Node n3 = this.Nodes[1] as Node;
                GraphContainer.Instance.NodeRelationship.Remove(n1);
                n1.Text = "";
                n3.Text = "";
                this.mapValue["gotolabel"] = "";
            }

            lblDescription.Text = ((frmProps)props).Description;
        }
Пример #6
0
        public DialogResult ShowProperties()
        {
            DialogResult result = DialogResult.Ignore;

            if (props != null)
            {
                props.Dispose();
            }

            props = null;

            props = new frmProps();

            ((frmProps)props).Activities     = this;
            ((frmProps)props).Description    = lblDescription.Text;
            ((frmProps)props).PropertyResult = this.ActivityValue;
            result = props.ShowDialog();

            return(result);
        }
        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();
        }