private static void saveXMLofControl(Control control, XmlNode controlXMLNode)
        {
            //Give Handle to XML Node to new Frame Element so it can write its own child
            string eibCOntrolInterfaceName = (typeof(IEIBControl)).Name;

            if (control.GetType().GetInterface(eibCOntrolInterfaceName) != null)
            {
                if (control.Name != null)
                {
                    Hashtable controlProperties = WorkflowXMLServices.updateSettings(control, ((IEIBControl)control).ControlName, control.Name.ToLower());
                    Hashtable eventProperties   = WorkflowXMLServices.updateEvents(control, control.Name.ToLower(), control.Name.ToLower());
                    XmlNode   xmlNode           = null;
                    if (!control.Name.Trim().Equals(""))
                    {
                        if (!(control is EIBFormDesigner.Workflow.Controls.MarkControl))
                        {
                            if (controlXMLNode == null)
                            {
                                if (control.GetType().Equals(typeof(EIBNode)))
                                {
                                    //controlProperties.Add(XMLServicesConstants.XmlNodeIdAtt, ((EIBNode)control).WorkFlowNode.WorkFlowNodeId);
                                    controlProperties.Add("scenario", EIBXMLUtilities.projectName);
                                    controlProperties.Add("isstart", ((EIBNode)control).startNodeCheck.Checked.ToString());
                                    //XmlNode xmlNode = XMLServices.writeElement(nodeEIB.ParentXmlNode, nodeEIB.ControlType, controlProperties, null);
                                    xmlNode = XMLServices.writeElement(((IEIBControl)(control.Parent)).ParentXmlNode, EIBControlList.GetRenderingElement(control.GetType().Name), controlProperties, eventProperties, null);
                                    saveXMLofNode(control, xmlNode);
                                }
                                if (control.GetType().Equals(typeof(EIBNodeConnector)))
                                {
                                    ((IEIBControl)control).ParentXmlNode = ((IEIBControl)(control.Parent)).ParentXmlNode;
                                    saveXMLofNodeConnector(control);
                                }
                            }
                            else
                            {
                                xmlNode = XMLServices.writeElement(controlXMLNode, EIBControlList.GetRenderingElement(control.GetType().Name), controlProperties, eventProperties, null);
                            }
                        }
                    }
                }
            }
        }
Beispiel #2
0
        public static void saveXMLofMenu(Control menuControl)
        {
            EIBMenuBar menuBar = (EIBMenuBar)menuControl;

            foreach (EIBMenu menu in menuBar.CurrentToolStrip.Items)
            {
                Hashtable controlProperties = EIBXMLServices.updateMenuSettings(menu, menu.Name, menu.Name);
                Hashtable eventProperties   = EIBXMLServices.updateMenuEvents(menu, menu.Name.ToLower(), menu.Name.ToLower());

                XmlNode xmlNode = EIBXMLServices.writeElement(((IEIBControl)menuControl).ParentXmlNode, EIBControlList.GetRenderingElement(menu.GetType().Name), controlProperties, eventProperties);

                foreach (EIBMenuItem menuItem in menu.DropDownItems)
                {
                    Hashtable menuItemProperties  = EIBXMLServices.updateMenuSettings(menuItem, menuItem.Name, menuItem.Name);
                    Hashtable menuEventProperties = EIBXMLServices.updateMenuEvents(menuItem, menuItem.Name.ToLower(), menuItem.Name.ToLower());

                    EIBXMLServices.writeElement(xmlNode, EIBControlList.GetRenderingElement(menuItem.GetType().Name), menuItemProperties, menuEventProperties);
                }
            }
        }
Beispiel #3
0
        private static void saveXMLofControl(Control control, XmlNode controlXMLNode)
        {
            //Give Handle to XML Node to new Frame Element so it can write its own child
            string eibCOntrolInterfaceName = (typeof(IEIBControl)).Name;

            if (control.GetType().GetInterface(eibCOntrolInterfaceName) != null)
            {
                if (control.Name != null)
                {
                    Hashtable controlProperties = EIBXMLServices.updateSettings(control, ((IEIBControl)control).ControlName, control.Name.ToLower());
                    Hashtable eventProperties   = EIBXMLServices.updateEvents(control, control.Name.ToLower(), control.Name.ToLower());
                    XmlNode   xmlNode           = null;
                    if (!control.Name.Trim().Equals(""))
                    {
                        if (!(control is EIBTabPage))
                        {
                            if (controlXMLNode == null)
                            {
                                xmlNode = EIBXMLServices.writeElement(((IEIBControl)(control.Parent)).ParentXmlNode, EIBControlList.GetRenderingElement(control.GetType().Name), controlProperties, eventProperties);
                            }
                            else
                            {
                                xmlNode = EIBXMLServices.writeElement(controlXMLNode, EIBControlList.GetRenderingElement(control.GetType().Name), controlProperties, eventProperties);
                            }
                        }
                        if (control.GetType().Equals(typeof(EIBPanel)))
                        {
                            ((IEIBControl)control).ParentXmlNode = xmlNode;
                            saveXMLofChildren(control);
                        }
                        if (control.GetType().Equals(typeof(EIBTreeView)))
                        {
                            ((IEIBControl)control).ParentXmlNode = xmlNode;
                            saveXMLofTreeView(control, null);
                        }
                        if (control.GetType().Equals(typeof(EIBTabControl)))
                        {
                            ((IEIBControl)control).ParentXmlNode = xmlNode;
                            saveXMLofChildren(control);
                        }

                        if (control.GetType().Equals(typeof(EIBCombobox)))
                        {
                            ((IEIBControl)control).ParentXmlNode = xmlNode;
                            saveXMLofCombobox(control);
                        }
                        if (control.GetType().Equals(typeof(EIBMenuBar)))
                        {
                            ((IEIBControl)control).ParentXmlNode = xmlNode;
                            saveXMLofMenu(control);
                        }
                        if (control.GetType().Equals(typeof(EIBGrid)))
                        {
                            ((IEIBControl)control).ParentXmlNode = xmlNode;
                            saveXMLofTable((EIBGrid)control);
                        }
                    }
                }
            }
        }
Beispiel #4
0
 public static void saveXMLofChildren(Control panelControl)
 {
     //Scroll for all tabpages
     if (panelControl is EIBTabControl)
     {
         EIBTabControl eibTabCOntrol = (EIBTabControl)panelControl;
         foreach (EIBTabPage tabPage in eibTabCOntrol.TabPages)
         {
             ((IEIBControl)tabPage).ParentXmlNode = eibTabCOntrol.ParentXmlNode;
             Hashtable controlProperties = EIBXMLServices.updateSettings(tabPage, ((IEIBControl)tabPage).ControlName, tabPage.Name.ToLower());
             Hashtable eventProperties   = EIBXMLServices.updateEvents(tabPage, tabPage.Name.ToLower(), tabPage.Name.ToLower());
             XmlNode   xmlNode           = null;
             if (!tabPage.Name.Trim().Equals(""))
             {
                 xmlNode = EIBXMLServices.writeElement((((IEIBControl)tabPage).ParentXmlNode), EIBControlList.GetRenderingElement(tabPage.GetType().Name), controlProperties, eventProperties);
                 ((IEIBControl)tabPage).ParentXmlNode = xmlNode;
             }
             // Save each Tab page as normal page
             saveXMLofChildren(tabPage);
         }
     }
     foreach (Control control in panelControl.Controls)
     {
         saveXMLofControl(control, null);
     }
 }
Beispiel #5
0
 public static void saveXMLofTreeView(Control treeViewControl, TreeNode treeNode)
 {
     if (treeViewControl != null)
     {
         EIBTreeView treeView = (EIBTreeView)treeViewControl;
         foreach (EIBTreeNode treeNodeChild in treeView.Nodes)
         {
             Hashtable controlProperties = new Hashtable();
             controlProperties.Add("name", treeNodeChild.Name);
             controlProperties.Add("text", treeNodeChild.Text);
             if (treeNodeChild.Nodes.Count == 0)
             {
                 controlProperties.Add("isleaf", true.ToString().ToLower());
             }
             Hashtable evntProperties = updateTreeNodeEvents(treeNodeChild, treeNodeChild.Name, treeNodeChild.Name);
             XmlNode   xmlNode        = EIBXMLServices.writeElement(treeView.ParentXmlNode, EIBControlList.GetRenderingElement(treeNodeChild.GetType().Name), controlProperties, evntProperties);
             treeNodeChild.ParentXmlNode = xmlNode;
             saveXMLofTreeView(null, treeNodeChild);
         }
     }
     else if (treeNode != null)
     {
         EIBTreeNode treeNodeParent = (EIBTreeNode)treeNode;
         foreach (EIBTreeNode treeNodeChild in treeNodeParent.Nodes)
         {
             Hashtable controlProperties = new Hashtable();
             controlProperties.Add("name", treeNodeChild.Name);
             controlProperties.Add("text", treeNodeChild.Text);
             if (treeNodeChild.Nodes.Count == 0)
             {
                 controlProperties.Add("isleaf", true.ToString().ToLower());
             }
             Hashtable evntProperties = updateTreeNodeEvents(treeNodeChild, treeNodeChild.Name, treeNodeChild.Name);
             XmlNode   xmlNode        = EIBXMLServices.writeElement(treeNodeParent.ParentXmlNode, EIBControlList.GetRenderingElement(treeNodeChild.GetType().Name), controlProperties, evntProperties);
             treeNodeChild.ParentXmlNode = xmlNode;
             saveXMLofTreeView(null, treeNodeChild);
         }
     }
 }