예제 #1
0
 public void InitializaTab(EIBNode node)
 {
     InitializeWorkflowFormPatternTab(node);
     InitializeWorkflowDataPatternTab(node);
     InitializeWorkflowUserPatternTab(node);
     InitializeWorkflowNodeStatusTab(node);
     listofTabs[0].Show(dockPanel, DockState.Document);
 }
예제 #2
0
        public NodeConfigurationWizard(EIBNode node)
        {
            listofTabs = new List<DockContent>();

            InitializeComponent();
            InitializaTab(node);
            //this.dockPanel.Extender
        }
예제 #3
0
 /// <summary>
 /// creates a WorkflowFormPattern object 
 /// </summary>
 /// <param name="iswizardstep">true if the WorkflowFormPattern is the wizardstep else false.</param>
 public static WorkflowDataPattern CreateInstance(bool iswizardstep,EIBNode node)
 {
     WorkflowDataPattern workflowdatapattern = new WorkflowDataPattern(iswizardstep);
     if (iswizardstep)
     {
         workflowdatapattern.DockAreas = DockAreas.Document;
         workflowdatapattern.CloseButton = false;
     }
     workflowdatapattern.Node = node;
     return workflowdatapattern;
 }
예제 #4
0
 //Retrieves a Line object having a mark
 private Line getLineByMark(EIBNode m)
 {
     foreach (Line l in ((BaseWindow)this.baseFrame.Parent).Lines)
     {
         if (l.mark1 == m || l.mark2 == m)
         {
             return(l);
         }
     }//Never happens :D
     throw new System.Exception("No line found");
 }
예제 #5
0
 public void InitializeWorkflowNodeStatusTab(EIBNode node)
 {
     WorkflowNodeStatus workflownodestatus = WorkflowNodeStatus.CreateInstance(true, node);
     workflownodestatus.setNodeStatus(node.WorkFlowNode.DataObject.Status);
     workflownodestatus.Show(dockPanel, DockState.Document);
     workflownodestatus.TabText = "WorkflowNodeStatus";
     workflownodestatus.PanelPane.AllowDockDragAndDrop = false;
     workflownodestatus.button1.Visible = false;
     workflownodestatus.button2.Visible = false;
     listofTabs.Add(workflownodestatus);
 }
예제 #6
0
 public void InitializeWorkflowFormPatternTab(EIBNode node)
 {
     WorkflowFormPattern workflowFormPattern = WorkflowFormPattern.CreateInstance(true,node);
     workflowFormPattern.CheckListofFormpatterns();
     workflowFormPattern.Show(dockPanel, DockState.Document);
     workflowFormPattern.TabText = "WorkflowFormPattern";
     workflowFormPattern.PanelPane.AllowDockDragAndDrop = false;
     workflowFormPattern.button1.Visible = false;
     workflowFormPattern.button2.Visible = false;
     listofTabs.Add(workflowFormPattern);
 }
예제 #7
0
        ///// <summary>
        ///// creates a WorkflowFormPattern object 
        ///// </summary>
        ///// <param name="iswizardstep">true if the WorkflowFormPattern is the wizardstep else false.</param>
        public static WorkflowNodeStatus CreateInstance(bool iswizardstep, EIBNode node)
        {
            WorkflowNodeStatus workflownodestatus = new WorkflowNodeStatus(iswizardstep);
            if (iswizardstep)
            {
                workflownodestatus.DockAreas = DockAreas.Document;
                workflownodestatus.CloseButton = false;
            }
            workflownodestatus.Node = node;

            return workflownodestatus;
        }
예제 #8
0
        private void Mark_MouseMove(object sender, MouseEventArgs e)
        {
            if (isSelected)
            {
                EIBNode mc1 = (EIBNode)sender;
                Line    l   = getLineByMark(mc1);

                Point p = new Point(e.X - _X + mc1.Left, e.Y - _Y + mc1.Top);

                mc1.Location = p;

                Redraw(l, p);
            }
        }
예제 #9
0
 public void AssociateMarkUpandDown(EIBNode node)
 {
     node.MouseUp   += new System.Windows.Forms.MouseEventHandler(this.Mark_MouseUp);
     node.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Mark_MouseDown);
 }
예제 #10
0
        public static object CreateControl(string ctrlName, string partialName)
        {
            try
            {
                Control ctrl = null;
                //ToolStripMenuItem menu;
                //ToolStripButton menuItem;
                switch (ctrlName)
                {
                    case "EIBButton":
                        ctrl = new EIBButton();
                        break;
                    case "EIBApplet":
                        ctrl = new EIBApplet();
                        break;
                    case "EIBLattice":
                        ctrl = new EIBLattice();
                        break;
                    case "EIBSchedular":
                        ctrl = new EIBSchedular();
                        break;
                    case "EIBDatePicker":
                        ctrl = new EIBDatePicker();
                        break;
                    case "EIBTime":
                        ctrl = new EIBTime();
                        break;
                    case "EIBCheckbox":
                        ctrl = new EIBCheckbox();
                        break;
                    case "EIBCombobox":
                        ctrl = new EIBCombobox();
                        break;
                    case "EIBLabel":
                        ctrl = new EIBLabel();
                        break;
                    case "EIBLine":
                        ctrl = new EIBLine();
                        break;
                    case "EIBPanel":
                        ctrl = new EIBPanel();
                        DragDropHandler.RegisterControl(ctrl, true, true);
                        break;
                    case "EIBJasper":
                        ctrl = new EIBJasper();
                        break;
                    case "EIBRadioGroup":
                        ctrl = new EIBRadioGroup();
                        DragDropHandler.RegisterControl(ctrl, true, true);
                        break;
                    case "EIBPicture":
                        ctrl = new EIBPicture();
                        break;
                    case "EIBRadioButton":
                        ctrl = new EIBRadioButton();
                        break;
                    case "EIBTabControl":
                        ctrl = new EIBTabControl();
                        DragDropHandler.RegisterControl(ctrl, true, true);
                        break;
                    case "EIBTabPage":
                        ctrl = new EIBTabPage();
                        DragDropHandler.RegisterControl(ctrl, true, true);
                        break;
                    case "EIBSearch":
                        ctrl = new EIBSearch();
                        break;
                    case "EIBListbox":
                        ctrl = new EIBListbox();
                        break;
                    case "EIBGrid":
                        ctrl = new EIBGrid();
                        DragDropHandler.RegisterControl(ctrl, true, true);
                        break;
                    case "EIBTable":
                        ctrl = new EIBTable();
                        break;
                    case "EIBRelation":
                        ctrl = new EIBRelation();
                        break;
                    case "EIBTextBox":
                        ctrl = new EIBTextBox();
                        break;
                    case "EIBTreeView":
                        ctrl = new EIBTreeView();
                        break;
                    case "EIBMenuBar":
                        ctrl = new EIBMenuBar(false);
                        DragDropHandler.RegisterControl(ctrl, true, true);
                        break;
                    case "EIBNode":
                        ctrl = new EIBNode();
                        break;
                    case "EIBNodeRelation":
                        ctrl = new EIBNodeRelation();
                        break;
                    case "EIBColumn":
                        ctrl = new EIBColumn();
                        DragDropHandler.RegisterControl(ctrl, true, true);
                        break;
                    case "EIBScrollableRow":
                        ctrl = new EIBScrollableRow();
                        DragDropHandler.RegisterControl(ctrl, true, true);
                        break;
                    case "EIBBrowse":
                        ctrl = new EIBBrowse();
                        break;
                    case "EIBVMenuBar":
                        ctrl = new EIBVMenuBar(false);
                        DragDropHandler.RegisterControl(ctrl, true, true);
                        break;
                    case "EIBMenu":
                        return new EIBMenu();
                    case "EIBMenuItem":
                        return new EIBMenuItem();
                    /*
                                        case "EIBTreeNode":
                                            ctrl = new EIBTreeNode();
                                            break;
                    */
                    default:
                        Assembly controlAsm = Assembly.LoadWithPartialName(partialName);
                        Type controlType = controlAsm.GetType(partialName + "." + ctrlName);
                        ctrl = (Control)Activator.CreateInstance(controlType);
                        break;

                }

                return ctrl;

            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine("create control failed:" + ex.Message);
                return new Control();
            }
        }
        //Deserialize individual base windows and there child control
        public static void DeserializeWindowXML(string fileName, Control baseFrame, XmlNode parentXMLNode)
        {
            DataSet dataset = new DataSet();
            XmlDocument doc = new XmlDocument();
            XmlNode currentXmlNode = null;
            Dictionary<string, EIBNode> listNode = new Dictionary<string, EIBNode>();
            try
            {

                // disabling re-drawing of treeview till all nodes are added
                baseFrame.SuspendLayout();
                fileName = fileName + ".xml";
                if (parentXMLNode == null)
                {
                    doc.Load(fileName);
                    currentXmlNode = doc.FirstChild;
                }
                else
                {
                    currentXmlNode = parentXMLNode;
                }
                baseFrame.Controls.Clear();
                if (currentXmlNode.Name == FormDesignerConstants.BaseWindow)
                {
                    // loading node attributes
                    UpdateControlProperties(baseFrame, currentXmlNode);
                }
                //Iterate all nodes

                foreach (XmlNode xmlNode in currentXmlNode.ChildNodes)
                {
                    if (xmlNode.NodeType == XmlNodeType.Element)
                    {
                        if (xmlNode.Name == FormDesignerConstants.NodeControl)
                        {
                            EIBNode.counter++;

                            EIBNode eibNode = new EIBNode();
                            UpdateControlProperties(eibNode, xmlNode);
                            eibNode.nodeIdText.Text = xmlNode.Attributes["id"].Value.ToString();
                            eibNode.startNodeCheck.Checked = (xmlNode.Attributes["isstart"].Value.ToLower().Equals("true"));
                           // baseFrame.Controls.Add(eibNode);
                            listNode.Add(eibNode.nodeIdText.Text, eibNode);
                            //EIBNode newNode = new EIBNode();
                           // UpdateControlProperties(newNode, xmlNode);
                           // newNode.nodeIdText.Text = xmlNode["workflownode"].Attributes["id"].Value.ToString();
                           // newNode.startNodeCheck.Checked = (xmlNode["workflownode"].Attributes["isstart"].Value.ToLower().Equals("true"));
                            //XmlNode xmlWorkFlowNode = getXMLNodeWithName(xmlNode,"workflownode")
                            //xmlNode[
                            eibNode.WorkFlowNode= Desearializeworkflownodexml(xmlNode);
                            eibNode.workflowNode.WorkFlowNodeId = eibNode.nodeIdText.Text;
                            eibNode.nodeIdText.Enabled = false;
                            ((BaseWindow)baseFrame.Parent).WorkflowNodes.Add(eibNode.workflowNode.WorkFlowNodeId, eibNode);
                            baseFrame.Controls.Add(eibNode);

                        }
                        if (xmlNode.Name == "connector")
                        {
                            try
                            {
                                //EIBNodeConnector.counter++;
                                EIBNodeConnector newNode = new EIBNodeConnector();
                                XmlNode xmlNodeconnector = xmlNode;
                                UpdateControlProperties(newNode, xmlNodeconnector);
                                XmlNode connectorNode = xmlNodeconnector;
                                //XmlNode fromNodeName = connectorNode["from"].Attributes["id"];
                                //XmlNode toNodeName = connectorNode["to"].Attributes["id"];
                                string fromNodeName = connectorNode["from"].Attributes["id"].Value;
                                string toNodeName = connectorNode["to"].Attributes["id"].Value;
                                EIBNode fromNode = listNode[fromNodeName];
                                EIBNode toNode = listNode[toNodeName];
                                Graphics g = null;
                                Bitmap bmpBack = new Bitmap(baseFrame.Width, baseFrame.Height);
                                Graphics.FromImage(bmpBack).Clear(baseFrame.BackColor);
                                baseFrame.BackgroundImage = (Bitmap)bmpBack.Clone();
                                g = Graphics.FromImage(baseFrame.BackgroundImage);
                                int centerMarkX = (fromNode.Center.X + toNode.Center.X) / 2;
                                int centerMarkY = (fromNode.Center.Y + toNode.Center.Y) / 2;
                                newNode.centerMark.Location = new Point(centerMarkX - 4, centerMarkY - 4);
                                newNode.InitiateSettings((EIBPanel)baseFrame);
                                newNode.Mark1 = fromNode;
                                newNode.Mark2 = toNode;
                                newNode.createLine();
                                baseFrame.Controls.Add(newNode.centerMark);
                                g.DrawLine(new Pen(Color.RoyalBlue, (float)2), fromNode.Center.X, fromNode.Center.Y, centerMarkX, centerMarkY);
                                g.DrawLine(new Pen(Color.RoyalBlue, (float)2), toNode.Center.X, toNode.Center.Y, centerMarkX, centerMarkY);
                                baseFrame.Controls.Add(newNode);
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show("Connector xml Modified.");
                            }
                        }
                     }
                }
                //Iterate all nodes connector
                /*foreach (XmlNode xmlNodeconnector in currentXmlNode.ChildNodes)
                {
                    if (xmlNodeconnector.NodeType == XmlNodeType.Element)
                    {

                    }
                 }*/
            }
            catch (FileNotFoundException)
            {
                MessageBox.Show("Basewindow.xml not Found");
            }
            finally
            {
                baseFrame.ResumeLayout();
                // enabling redrawing of treeview after all nodes are added
                baseFrame.Invalidate();
            }
        }
예제 #12
0
 //Retrieves a Line object having a mark
 private Line getLineByMark(EIBNode m)
 {
     foreach (Line l in ((BaseWindow)this.baseFrame.Parent).Lines)
     {
         if (l.mark1 == m || l.mark2 == m)
             return l;
     }//Never happens :D
     throw new System.Exception("No line found");
 }
예제 #13
0
 public void AssociateMarkUpandDown(EIBNode node)
 {
     node.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Mark_MouseUp);
     node.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Mark_MouseDown);
 }