예제 #1
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);
                        }
                    }
                }
            }
        }
예제 #2
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);
     }
 }