예제 #1
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());
            }
        }
예제 #2
0
        public static Hashtable updateSettings(Control control, string elementName, string uniqueId)
        {
            //Add settings realted to control into hashtable which will later
            //be written in XML
            Hashtable controlProperties = new Hashtable();

            controlProperties.Add(XMLServicesConstants.XmlNodeNameAtt, elementName);
            controlProperties.Add(XMLServicesConstants.XmlNodeIdAtt, uniqueId);
            controlProperties.Add(XMLServicesConstants.XmlNodeWidthAtt, control.Width.ToString());
            controlProperties.Add(XMLServicesConstants.XmlNodeHeightAtt, control.Height.ToString());
            string htmlColor = "";

            if (control.BackColor == Color.Transparent)
            {
                htmlColor = "Transparent";
            }
            else
            {
                htmlColor = string.Concat("#", (control.BackColor.ToArgb() & 0x00FFFFFF).ToString("X6"));
            }
            controlProperties.Add(XMLServicesConstants.XmlNodeBackColorAtt, htmlColor);
            controlProperties.Add(XMLServicesConstants.XmlNodeFontAtt, control.Font.Name);
            controlProperties.Add(XMLServicesConstants.XmlNodeFontSizeAtt, control.Font.Size.ToString());
            string foreColor = "";

            if (control.ForeColor == Color.Transparent)
            {
                foreColor = "Transparent";
            }
            else
            {
                foreColor = string.Concat("#", (control.ForeColor.ToArgb() & 0x00FFFFFF).ToString("X6"));
            }
            controlProperties.Add(XMLServicesConstants.XmlNodeVisibleAtt, control.Visible.ToString().ToLower());
            controlProperties.Add(XMLServicesConstants.XmlNodeForeColorAtt, foreColor);
            controlProperties.Add(XMLServicesConstants.XmlNodeFontStyleAtt, control.Font.Style.ToString());
            controlProperties.Add(XMLServicesConstants.XmlNodeXAtt, control.Location.X.ToString());
            controlProperties.Add(XMLServicesConstants.XmlNodeYAtt, control.Location.Y.ToString());
            controlProperties.Add(XMLServicesConstants.XmlNodeTextAtt, control.Text);
            controlProperties.Add(XMLServicesConstants.XmlNodeAllignAtt, control.Dock.ToString());
            controlProperties.Add(XMLServicesConstants.XmlNodeNetBackColorAtt, control.BackColor.ToKnownColor().ToString());

            //Attributes specific to COntrols
            if (control is EIBTextBox)
            {
                EIBTextBox textBoxEIB = (EIBTextBox)control;
                controlProperties.Add(XMLServicesConstants.XmlNodePasswordAtt, textBoxEIB.UseSystemPasswordChar.ToString().ToLower());
                controlProperties.Add(XMLServicesConstants.XmlNodeMultiLineAtt, textBoxEIB.Multiline.ToString().ToLower());
            }
            if (control is EIBPanel)
            {
                EIBPanel panelEIB = (EIBPanel)control;
                controlProperties.Add(XMLServicesConstants.XmlNodeBorderAtt, panelEIB.BorderStyle.ToString().ToLower());
                controlProperties.Add(XMLServicesConstants.XmlNodeDefaultAtt, panelEIB.DefaultScreen.ToString().ToLower());
            }
            if (control is EIBRadioButton)
            {
                EIBRadioButton radioButton = (EIBRadioButton)control;
                controlProperties.Add(XMLServicesConstants.XmlNodeSelectedAtt, radioButton.Checked.ToString().ToLower());
            }
            if (control is EIBCheckbox)
            {
                EIBCheckbox checkbox = (EIBCheckbox)control;
                controlProperties.Add(XMLServicesConstants.XmlNodeSelectedAtt, checkbox.Checked.ToString().ToLower());
            }
            if (control is EIBPicture)
            {
                EIBPicture picture      = (EIBPicture)control;
                Image      pictureImage = picture.Image;


                if (pictureImage != null)
                {
                    string sourceImage = "\\img\\" + picture.ControlName + ".jpg";
                    String curDir      = Directory.GetCurrentDirectory();
                    if (!Directory.Exists(EIBXMLServices.folderName + "\\img\\"))
                    {
                        Directory.CreateDirectory(EIBXMLServices.folderName + "\\img\\");
                    }
                    try
                    {
                        pictureImage.Save(EIBXMLServices.folderName + sourceImage, System.Drawing.Imaging.ImageFormat.Jpeg);
                    }
                    catch (Exception)
                    {
                        //MessageBox.Show(ex.Message[0].ToString());
                        //do nothing
                    }
                    controlProperties.Add(XMLServicesConstants.XmlNodeSourceAtt, sourceImage);
                    Directory.SetCurrentDirectory(curDir);
                }
            }
            string eibCOntrolInterfaceName = (typeof(IEIBControl)).Name;

            if (control.GetType().GetInterface(eibCOntrolInterfaceName) != null)
            {
                IEIBControl eibControl = (IEIBControl)control;
                if (eibControl.DataPatternName != null && (!eibControl.DataPatternName.Trim().Equals("")))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeDataPatternAtt, eibControl.DataPatternName);
                }
                if (eibControl.DataTableName != null && (!eibControl.DataTableName.Trim().Equals("")))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeDataTableAtt, eibControl.DataTableName);
                }
                if (eibControl.DataFieldName != null && (!eibControl.DataFieldName.Trim().Equals("")))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeDataFieldAtt, eibControl.DataFieldName);
                }
            }
            return(controlProperties);
        }
예제 #3
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();
            }
        }
예제 #4
0
        //Deserialize individual base windows and there child control
        public static void DeserializeWindowXML(string fileName, Control baseFrame, XmlNode parentXMLNode)
        {
            XmlDocument doc = new XmlDocument();
            XmlNode currentXmlNode = null;
            EIBGrid grid = null;
            EIBLattice lattice = null;
            try
            {

                // disabling re-drawing of treeview till all nodes are added
                fileName = fileName + ".xml";
                if (parentXMLNode == null)
                {
                    doc.Load(fileName);
                    currentXmlNode = doc.FirstChild;
                    baseFrame.Controls.Clear();
                }
                else
                {
                    currentXmlNode = parentXMLNode;
                }
                // baseFrame.Controls.Clear();
                if (currentXmlNode.Name == FormDesignerConstants.BaseWindow)
                {
                    // loading node attributes
                    UpdateControlProperties(baseFrame, currentXmlNode);
                    ((EIBPanel)baseFrame).AutoScroll = true;
                }
                foreach (XmlNode xmlNode in currentXmlNode.ChildNodes)
                {
                    #region Desearilization for each control
                    if (xmlNode.NodeType == XmlNodeType.Element)
                    {

                        if (xmlNode.Name == FormDesignerConstants.TextBoxControl)
                        {
                            EIBTextBox newNode = new EIBTextBox();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBTextBox.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.SchedularControl)
                        {
                            EIBSchedular newNode = new EIBSchedular();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBSchedular.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.AppletControl)
                        {
                            EIBApplet newNode = new EIBApplet();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBApplet.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.ButtonControl)
                        {
                            EIBButton newNode = new EIBButton();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBButton.counter++;
                            //UIEventManager.form.Controlpool.Add(newNode,);
                        }
                        if (xmlNode.Name == FormDesignerConstants.JasperControl)
                        {
                            EIBJasper newNode = new EIBJasper();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBJasper.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.DatePickerControl)
                        {
                            EIBDatePicker newNode = new EIBDatePicker();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBDatePicker.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.TimeControl)
                        {
                            EIBTime newNode = new EIBTime();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            newNode.ShowTimeSplit();
                            EIBTime.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.CalenderControl)
                        {
                            EIBCalender newNode = new EIBCalender();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBCalender.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.LabelControl)
                        {
                            EIBLabel newNode = new EIBLabel();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBLabel.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.RadioControl)
                        {
                            EIBRadioButton newNode = new EIBRadioButton();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBRadioButton.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.CheckboxControl)
                        {
                            EIBCheckbox newNode = new EIBCheckbox();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBCheckbox.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.ComboControl)
                        {
                            EIBCombobox newNode = new EIBCombobox();
                            UpdateControlProperties(newNode, xmlNode);
                            UpdateComboBoxValues(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBCombobox.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.PagingControl)
                        {
                            EIBPaging newNode = new EIBPaging();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBPaging.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.ImageBrowseControl)
                        {
                            EIBImageBrowse newNode = new EIBImageBrowse();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBImageBrowse.counter++;
                        }
                        /*if (xmlNode.Name == FormDesignerConstants.MenuBarControl)
                        {
                            EIBMenuBar.counter++;
                            EIBMenuBar newNode = new EIBMenuBar();
                            UpdateControlProperties(newNode, xmlNode);
                            UpdateMenuValues(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            newNode.Height = 25;
                            newNode.Width = newNode.Parent.Width;
                            newNode.CurrentToolStrip.Dock = DockStyle.Fill;
                            DragDropHandler.RegisterControl(newNode, true, true);
                            newNode.Click += new EventHandler(FormDesigner.eventManager.handleMenuClick);
                            currentControl = newNode;
                        }*/
                        if (xmlNode.Name == FormDesignerConstants.MenuBarControl)
                        {
                            EIBVMenuBar newNode = new EIBVMenuBar();
                            UpdateControlProperties(newNode, xmlNode);
                            UpdateMenuValues(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            newNode.Dock = DockStyle.None;
                            baseFrame.Controls.Add(newNode);
                            DragDropHandler.RegisterControl(newNode, true, true);
                            newNode.PerformLayout();
                            //newNode.Size = new Size(30, 30);
                            //newNode.Click += new EventHandler(FormDesigner.eventManager.handleMenuClick);
                            currentControl = newNode;
                            EIBVMenuBar.counter++;

                        }
                        if (xmlNode.Name == FormDesignerConstants.FrameControl)
                        {
                            EIBPanel newNode = new EIBPanel();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                            DragDropHandler.RegisterControl(newNode, true, true);
                            Console.Write("Done with Frame");
                            EIBPanel.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.PlaceHolderControl)
                        {
                            EIBPlaceHolder newNode = new EIBPlaceHolder();

                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                            DragDropHandler.RegisterControl(newNode, true, true);
                            Console.Write("Done with PlaceHolder");
                            EIBPlaceHolder.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.UserControl)
                        {
                            EIBItem newNode = new EIBItem();

                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            //EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                            //DragDropHandler.RegisterControl(newNode, true, true);
                            Console.Write("Done with Item");
                            EIBItem.counter++;
                        }

                        if (xmlNode.Name == FormDesignerConstants.RadioGroupControl)
                        {
                            EIBRadioGroup newNode = new EIBRadioGroup();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                            DragDropHandler.RegisterControl(newNode, true, true);
                            //Console.Write("Done with EIBradioGroup");
                            EIBRadioGroup.counter++;
                        }

                        if (xmlNode.Name == FormDesignerConstants.PictureControl)
                        {
                            EIBPicture newNode = new EIBPicture();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBPicture.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.GridControl)
                        {
                            EIBGrid newNode = new EIBGrid();
                            UpdateControlProperties(newNode, xmlNode);
                            currentControl = newNode;
                            baseFrame.Controls.Add(newNode);
                            DragDropHandler.RegisterControl(newNode, true, true);
                            EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                            EIBGrid.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.LatticeControl)
                        {
                            EIBLattice newNode = new EIBLattice();
                            UpdateControlProperties(newNode, xmlNode);
                            currentControl = newNode;
                            baseFrame.Controls.Add(newNode);
                            DragDropHandler.RegisterControl(newNode, true, true);
                            EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                            EIBLattice.counter++;
                        }
                        if (xmlNode.Name.Trim().Equals(FormDesignerConstants.RowControl, StringComparison.CurrentCultureIgnoreCase))
                        {
                            EIBRow newNode = new EIBRow();
                            if (currentControl is EIBGrid)
                            {
                                if (currentControl is EIBGrid)
                                {
                                    grid = (EIBGrid)currentControl;
                                    UpdateControlProperties(newNode, xmlNode);
                                    DragDropHandler.RegisterControl(newNode, true, true);
                                    grid.Rows.Add(newNode);
                                    currentControl = newNode;
                                    EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                                    EIBRow.counter++;
                                }
                            }

                        }
                        //added for LROW
                        if (xmlNode.Name.Trim().Equals(FormDesignerConstants.LRowControl, StringComparison.CurrentCultureIgnoreCase))
                        {
                            EIBRow newNode = new EIBRow();
                            if (currentControl is EIBLattice)
                            {
                                if (currentControl is EIBLattice)
                                {
                                    lattice = (EIBLattice)currentControl;
                                    UpdateControlProperties(newNode, xmlNode);
                                    DragDropHandler.RegisterControl(newNode, true, true);
                                    lattice.Rows.Add(newNode);
                                    IEIBControl parent = currentControl;
                                    currentControl = newNode;
                                    EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                                    currentControl = parent;
                                    EIBRow.counter++;
                                }
                            }

                        }
                        if (xmlNode.Name.Trim().Equals(FormDesignerConstants.ColumnControl, StringComparison.CurrentCultureIgnoreCase))
                        {
                            EIBColumn newNode = new EIBColumn();
                            if (currentControl is EIBRow)
                            {
                                EIBRow row = (EIBRow)currentControl;
                                row.Columns.Add(newNode);
                                DragDropHandler.RegisterControl(newNode, true, true);
                                UpdateControlProperties(newNode, xmlNode);
                            }
                            EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                            EIBColumn.counter++;
                        }
                        //added for LCOLUMN
                        if (xmlNode.Name.Trim().Equals(FormDesignerConstants.LColumnControl, StringComparison.CurrentCultureIgnoreCase))
                        {
                            EIBColumn newNode = new EIBColumn();
                            if (currentControl is EIBRow)
                            {
                                EIBRow row = (EIBRow)currentControl;
                                row.Columns.Add(newNode);
                                DragDropHandler.RegisterControl(newNode, true, true);
                                UpdateControlProperties(newNode, xmlNode);
                            }
                            EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                            EIBColumn.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.ListControl)
                        {
                            EIBListbox newNode = new EIBListbox();
                            UpdateControlProperties(newNode, xmlNode);
                            UpdateListBoxValues(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBListbox.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.MultiTabControl)
                        {
                            EIBTabControl newNode = new EIBTabControl();
                            UpdateControlProperties(newNode, xmlNode);
                            //newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                            DragDropHandler.RegisterControl(newNode, true, true);
                            EIBTabControl.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.TreeNodeControl)
                        {
                            EIBTreeNode newNode = new EIBTreeNode();
                            currentTreeControl = null;
                            UpdateTreeNodeProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            if ((currentControl != null) && (currentControl is EIBTreeView))
                            {
                                if (!(((EIBTreeView)currentControl).Nodes.Contains(newNode)))
                                {
                                    ((EIBTreeView)currentControl).Nodes.Add(newNode);
                                }
                            }
                            //baseFrame.Controls.Add(newNode);
                            EIBTreeNode.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.TabPage)
                        {
                            EIBTabPage newNode = new EIBTabPage();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                            EIBTabPage.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.TreeControl)
                        {
                            EIBTreeView newNode = new EIBTreeView();
                            UpdateControlProperties(newNode, xmlNode);
                            newNode.InitiateSettings(null);
                            baseFrame.Controls.Add(newNode);
                            currentControl = newNode;
                            EIBDeserializeServices.DeserializeWindowXML(null, newNode, xmlNode);
                            DragDropHandler.RegisterControl(newNode, true, true);
                            EIBTreeView.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.SearchControl)
                        {
                            EIBSearch eibSearch = new EIBSearch();
                            UpdateControlProperties(eibSearch, xmlNode);
                            eibSearch.SearchDesign = new EIBFormDesigner.Search.SearchDesigner(baseFrame);
                            eibSearch.SearchDesign.initSearchFrame(baseFrame);
                            UpdateSearchProperties(eibSearch.SearchDesign, xmlNode);
                            baseFrame.Controls.Add(eibSearch);
                            EIBSearch.counter++;
                        }
                        if (xmlNode.Name == FormDesignerConstants.BrowseControl)
                        {
                            EIBBrowse eibBrowse = new EIBBrowse();
                            UpdateControlProperties(eibBrowse, xmlNode);
                            eibBrowse.InitiateSettings(null);
                            baseFrame.Controls.Add(eibBrowse);
                            EIBBrowse.counter++;
                        }
                    }
                    #endregion
                    // moving up to in TreeView if end tag is encountered
                }
            }
            catch (FileNotFoundException ex)
            {
                MessageBox.Show("The File " + ex.FileName + " not found.");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Occured.\n Xml File Was Modified."+ex.Message);
            }
            finally
            {

            }
        }