public static Hashtable updateMenuEvents(ToolStripItem control, string elementName, string uniqueId) { Hashtable controlProperties = new Hashtable(); string eibCOntrolInterfaceName = (typeof(IEIBControl)).Name; if (control.GetType().GetInterface(eibCOntrolInterfaceName) != null) { IEIBControl eibControl = (IEIBControl)control; if (eibControl.OnClickValue != null && !eibControl.OnClickValue.Trim().Equals("")) { controlProperties.Add(XMLServicesConstants.XmlNodeOnClickElt, eibControl.OnClickValue); } if (eibControl.OnDoubleClick != null && !eibControl.OnDoubleClick.Trim().Equals("")) { controlProperties.Add(XMLServicesConstants.XmlNodeOnDoubleClickElt, eibControl.OnDoubleClick); } if (eibControl.EnteringValue != null && !eibControl.EnteringValue.Trim().Equals("")) { controlProperties.Add(XMLServicesConstants.XmlNodeEnteringElt, eibControl.EnteringValue); } if (eibControl.ExitingValue != null && !eibControl.ExitingValue.Trim().Equals("")) { controlProperties.Add(XMLServicesConstants.XmlNodeExitingElt, eibControl.ExitingValue); } if (eibControl.DefaultValue != null && !eibControl.DefaultValue.Trim().Equals("")) { controlProperties.Add(XMLServicesConstants.XmlNodeDefaultValueElt, eibControl.DefaultValue); } } //EIBControl Settings return(controlProperties); }
private static void SetEIBAttributeValue(IEIBControl node, string propertyName, string value) { if (propertyName == XMLServicesConstants.XmlNodeNameAtt) { node.ControlName = value; } }
public void displayFormulaProperties(FormulaEditorWindow form, IEIBControl controlObject) { try { if (form.SelectedNode != null) { if(form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.DefaultValue)) { form.formulaText.Text = controlObject.DefaultValue; } if(form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnClick)) { form.formulaText.Text = controlObject.OnClickValue; } else if(form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.Exiting)) { form.formulaText.Text = controlObject.ExitingValue; } else if(form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.Entering)) { form.formulaText.Text = controlObject.EnteringValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnDoubleClick)) { form.formulaText.Text = controlObject.OnDoubleClick; } } } catch (Exception exp) { Console.Write(exp.StackTrace); } }
public static void RefreshInList(IEIBControl control) { if (control is EIBVMenuBar) { if (!EIBControlCollection.MenuBarlist.ContainsKey(((Control)control).Name)) { EIBControlCollection.HMenuBarlist.Add(((Control)control).Name, ((Control)control).Name); } foreach (EIBMenu menu in ((EIBVMenuBar)control).Items) { RefreshInList(menu); } } if (control is EIBMenu) { if (!EIBControlCollection.Menulist.ContainsKey(((ToolStripItem)control).Name)) { EIBControlCollection.Menulist.Add(((ToolStripItem)control).Name, ((ToolStripItem)control).Name); } foreach (IEIBControl menuControl in ((EIBMenu)control).DropDownItems) { RefreshInList(menuControl); } } if (control is EIBMenuItem) { if (!EIBControlCollection.MenuItemlist.ContainsKey(((ToolStripItem)control).Name)) { EIBControlCollection.MenuItemlist.Add(((ToolStripItem)control).Name, ((ToolStripItem)control).Name); } } }
public void displayFormulaProperties(FormulaEditorWindow form, IEIBControl controlObject) { try { if (form.SelectedNode != null) { if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.DefaultValue)) { form.formulaText.Text = controlObject.DefaultValue; } if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnClick)) { form.formulaText.Text = controlObject.OnClickValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.Exiting)) { form.formulaText.Text = controlObject.ExitingValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.Entering)) { form.formulaText.Text = controlObject.EnteringValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnDoubleClick)) { form.formulaText.Text = controlObject.OnDoubleClick; } } } catch (Exception exp) { Console.Write(exp.StackTrace); } }
public override IMemento <ControlPool> Restore(ControlPool target) { IEIBControl removed = target[index]; IMemento <ControlPool> inverse = new RemoveControlMemento(index, removed); target.RemoveAt(index); return(inverse); }
private static void FindPagingControls(Dictionary <string, Control> PagingDictionary, int counter, Control baseWindow) { foreach (Control control in baseWindow.Controls) { if ((control is EIBPaging) && !(control.Name.Trim().Equals(""))) { IEIBControl eibControl = (IEIBControl)control; PagingDictionary.Add(control.Name, control); counter++; } if (control is EIBPanel || control is EIBTabControl || control is EIBTabPage || control is EIBRadioGroup) { FindPagingControls(PagingDictionary, counter, control); } } }
private static void FindSearchControls(Dictionary <int, Control> searchDictionary, int counter, Control baseWindow) { foreach (Control control in baseWindow.Controls) { if ((control is EIBSearch) && !(control.Name.Trim().Equals(""))) { IEIBControl eibControl = (IEIBControl)control; //this.searchList.Items.Add(eibControl.ControlName); searchDictionary.Add(counter, control); counter++; } if (control is EIBPanel || control is EIBTabControl || control is EIBTabPage || control is EIBRadioGroup) { FindSearchControls(searchDictionary, counter, control); } } }
private static void SetEIBAttributeValue(IEIBControl node, string propertyName, string value) { if (propertyName == XMLServicesConstants.XmlNodeNameAtt) { node.ControlName = value; } }
public DontDeleteControlMemento(IEIBControl control, IEIBControl parent, EIBFormDesigner.Designer.BaseWindow basewin) { dCtrl = control; this.parentControl = parent; this.baseWindow = basewin; }
private static void UpdateMenuValues(IEIBControl menuBar, XmlNode menubarNode) { //DragDropHandler.RegisterControl(menuBar, true, true); if (menubarNode.ChildNodes.Count > 0) { foreach (XmlNode menuNode in menubarNode.ChildNodes) { if (menuNode.Name != "Events" && menuNode.Name != "DataMappings") { EIBMenu menu = new EIBMenu(); SetMenuValue(menu, menuNode); //menu.InitiateSettings(null); menu.ControlName = menu.Name; menu.UniqueId = menuNode.Attributes["id"].Value; menu.Click += new EventHandler(FormDesigner.eventManager.handleMenuClick); if (menuBar is EIBMenuBar) { ((EIBMenuBar)menuBar).CurrentToolStrip.Items.Add(menu); ((EIBMenuBar)menuBar).CurrentMenu = menu; } else { ((EIBVMenuBar)menuBar).Items.Add(menu); ((EIBVMenuBar)menuBar).CurrentMenu = menu; } SetEIBEventsValue(menu, menuNode); if (menuNode.HasChildNodes) { UpdateSubMenuValues(menuBar, menuNode); } else { } EIBMenu.counter++; // FormDesignerUtilities.formWindowNames.Add(menu.UniqueId.ToString(), menu.UniqueId.ToString().ToLower()); ControlValidation.addUniqueIdToList(menu.UniqueId.ToString()); } //control.Items.Add(childXMLNode.Attributes[XMLServicesConstants.XmlNodeTextAtt].Value.ToString()); //foreach (XmlNode Node in menuNode.ChildNodes) //{ // if (Node.Name == FormDesignerConstants.MenuControl) // { // EIBMenu submenu = new EIBMenu(); // //submenu.InitiateSettings(null); // SetMenuValue(submenu, Node); // submenu.Click += new EventHandler(FormDesigner.eventManager.handleMenuItemClick); // //menuItem.ControlName = menuItem.Name; // menuBar.CurrentMenu.DropDownItems.Add(submenu); // menuBar.CurrentMenu.CurrentMenuItem = menuItem; // //to deserialise the evnts related to menu items // SetEIBEventsValue(menuItem, menuItemNode); // } // EIBMenuItem menuItem = new EIBMenuItem(); // menuItem.InitiateSettings(null); // SetMenuValue(menuItem, menuItemNode); // menuItem.Click += new EventHandler(FormDesigner.eventManager.handleMenuItemClick); // //menuItem.ControlName = menuItem.Name; // menuBar.CurrentMenu.DropDownItems.Add(menuItem); // menuBar.CurrentMenu.CurrentMenuItem = menuItem; // //to deserialise the evnts related to menu items // SetEIBEventsValue(menuItem, menuItemNode); //} } } else { } }
public RemoveControlMemento(int index, IEIBControl removed) { this.index = index; this.removed = removed; }
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); }
private void designTree_AfterSelect(object sender, TreeViewEventArgs e) { currentBaseWindow = form.currentBaseWindow; if (currentBaseWindow != null) { IEIBControl control = form.currentBaseWindow.CurrentControl[0]; TreeView treeControl = (TreeView)sender; selectedNode = treeControl.SelectedNode; if (currentBaseWindow != null) { if (currentBaseWindow.TypeOfWindow == FormDesignerConstants.FormPattern) { if (selectedNode != null) { this.formulaText.Enabled = true; if (currentBaseWindow.CurrentControl != null && currentBaseWindow.CurrentControl.Count == 1) { if (selectedNode.Name.Trim().Equals(FormDesignerConstants.DefaultValue)) { if (currentBaseWindow.CurrentControl[0].DefaultValue == null) { currentBaseWindow.CurrentControl[0].DefaultValue = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].DefaultValue; } if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnClick)) { if (currentBaseWindow.CurrentControl[0].OnClickValue == null) { currentBaseWindow.CurrentControl[0].OnClickValue = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].OnClickValue; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.Exiting)) { if (currentBaseWindow.CurrentControl[0].ExitingValue == null) { currentBaseWindow.CurrentControl[0].ExitingValue = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].ExitingValue; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.Entering)) { if (currentBaseWindow.CurrentControl[0].EnteringValue == null) { currentBaseWindow.CurrentControl[0].EnteringValue = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].EnteringValue; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnDoubleClick)) { if (currentBaseWindow.CurrentControl[0].OnDoubleClick == null) { currentBaseWindow.CurrentControl[0].OnDoubleClick = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].OnDoubleClick; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnDrop)) { if (currentBaseWindow.CurrentControl[0].OnDrop == null) { currentBaseWindow.CurrentControl[0].OnDrop = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].OnDrop; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnFocus)) { if (currentBaseWindow.CurrentControl[0].OnFocus == null) { currentBaseWindow.CurrentControl[0].OnFocus = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].OnFocus; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnBlur)) { if (currentBaseWindow.CurrentControl[0].OnBlur == null) { currentBaseWindow.CurrentControl[0].OnBlur = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].OnBlur; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnEventCreate)) { if (currentBaseWindow.CurrentControl[0].OnEventCreateValue == null) { currentBaseWindow.CurrentControl[0].OnEventCreateValue = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].OnEventCreateValue; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnEventEdit)) { if (currentBaseWindow.CurrentControl[0].OnEventEditValue == null) { currentBaseWindow.CurrentControl[0].OnEventEditValue = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].OnEventEditValue; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnEventUpdate)) { if (currentBaseWindow.CurrentControl[0].OnEventUpdateValue == null) { currentBaseWindow.CurrentControl[0].OnEventUpdateValue = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].OnEventUpdateValue; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnChange)) { if (currentBaseWindow.CurrentControl[0].OnChange == null) { currentBaseWindow.CurrentControl[0].OnChange = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].OnChange; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnOK)) { if (currentBaseWindow.CurrentControl[0].OnOK == null) { currentBaseWindow.CurrentControl[0].OnOK = ""; } formulaText.Text = currentBaseWindow.CurrentControl[0].OnOK; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.GlobalScripts)) { if (((EIBPanel)control).GlobalScripts == null) { ((EIBPanel)control).GlobalScripts = ""; } formulaText.Text = ((EIBPanel)control).GlobalScripts; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnCheck)) { if (((EIBCheckbox)control).OnCheck == null) { ((EIBCheckbox)control).OnCheck = ""; } formulaText.Text = ((EIBCheckbox)control).OnCheck; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnOpen)) { if (control is EIBTreeNode) { if (((EIBTreeNode)control).OnOpen == null) { ((EIBTreeNode)control).OnOpen = ""; } formulaText.Text = ((EIBTreeNode)control).OnOpen; } else if (control is EIBCombobox) { if (((EIBCombobox)control).OnOpen == null) { ((EIBCombobox)control).OnOpen = ""; } formulaText.Text = ((EIBCombobox)control).OnOpen; } } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnSelect)) { if (control is EIBTreeView) { if (((EIBTreeView)control).OnSelect == null) { ((EIBTreeView)control).OnSelect = ""; } formulaText.Text = ((EIBTreeView)control).OnSelect; } else if (control is EIBGrid) { if (((EIBGrid)control).OnSelect == null) { ((EIBGrid)control).OnSelect = ""; } formulaText.Text = ((EIBGrid)control).OnSelect; } } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnChanging)) { if (control is EIBCombobox) { if (((EIBCombobox)control).OnChanging == null) { ((EIBCombobox)control).OnChanging = ""; } formulaText.Text = ((EIBCombobox)control).OnChanging; } else if (control is EIBTextBox) { if (((EIBTextBox)control).OnChanging == null) { ((EIBTextBox)control).OnChanging = ""; } formulaText.Text = ((EIBTextBox)control).OnChanging; } } } } else { formulaText.Text = ""; MessageBox.Show("Please select a Form Pattern before entering Formula."); } } } else { MessageBox.Show("Please select a Form Pattern before entering Formula."); } //MessageBox.Show(sender.ToString()); //Display the basewindow current control's setting } }
private static void UpdateSubMenuValues(IEIBControl menuBar, XmlNode menuNode) { //DragDropHandler.RegisterControl(menuBar, true, true); if (menuNode.ChildNodes.Count > 0) { foreach (XmlNode Node in menuNode.ChildNodes) { if (Node.Name == FormDesignerConstants.MenuControl) { EIBMenu submenu = new EIBMenu(); SetMenuValue(submenu, Node); submenu.InitiateSettings(null); submenu.Click += new EventHandler(FormDesigner.eventManager.handleMenuClick); //menuItem.ControlName = menuItem.Name; if (menuBar is EIBMenuBar) { ((EIBMenuBar)menuBar).CurrentMenu.DropDownItems.Add(submenu); } else { ((EIBVMenuBar)menuBar).CurrentMenu.DropDownItems.Add(submenu); } //to deserialise the evnts related to menu items SetEIBEventsValue(submenu, Node); if (Node.HasChildNodes) { if (menuBar is EIBMenuBar) { ((EIBMenuBar)menuBar).CurrentMenu = submenu; ; } else { ((EIBVMenuBar)menuBar).CurrentMenu = submenu; } UpdateSubMenuValues(menuBar, Node); } //else //{ // menuBar.CurrentMenu = (EIBMenu)menuBar.CurrentMenu.OwnerItem; //} EIBMenu.counter++; } else if (Node.Name == FormDesignerConstants.MenuItemControl) { EIBMenuItem menuItem = new EIBMenuItem(); SetMenuValue(menuItem, Node); menuItem.InitiateSettings(null); menuItem.Click += new EventHandler(FormDesigner.eventManager.handleMenuItemClick); //menuItem.ControlName = menuItem.Name; if (menuBar is EIBMenuBar) { ((EIBMenuBar)menuBar).CurrentMenu.DropDownItems.Add(menuItem); ((EIBMenuBar)menuBar).CurrentMenu.CurrentMenuItem = menuItem; } else { ((EIBVMenuBar)menuBar).CurrentMenu.DropDownItems.Add(menuItem); ((EIBVMenuBar)menuBar).CurrentMenu.CurrentMenuItem = menuItem; } //to deserialise the evnts related to menu items SetEIBEventsValue(menuItem, Node); EIBMenuItem.counter++; } } if (menuBar is EIBMenuBar) { ((EIBMenuBar)menuBar).CurrentMenu = (EIBMenu)((EIBMenuBar)menuBar).CurrentMenu.OwnerItem; } else { ((EIBVMenuBar)menuBar).CurrentMenu = (EIBMenu)((EIBVMenuBar)menuBar).CurrentMenu.OwnerItem; } } else { //menuBar.CurrentMenu = (EIBMenu)menuBar.CurrentMenu.OwnerItem; } //if (menubarNode.ChildNodes.Count > 0) //{ // foreach (XmlNode menuNode in menubarNode.ChildNodes) // { // EIBMenu menu = new EIBMenu(); // // menu.InitiateSettings(null); // SetMenuValue(menu, menuNode); // //menu.ControlName = menu.Name; // menu.Click += new EventHandler(FormDesigner.eventManager.handleMenuClick); // menuBar.CurrentToolStrip.Items.Add(menu); // menuBar.CurrentMenu = menu; // //control.Items.Add(childXMLNode.Attributes[XMLServicesConstants.XmlNodeTextAtt].Value.ToString()); // foreach (XmlNode menuItemNode in menuNode.ChildNodes) // { // EIBMenuItem menuItem = new EIBMenuItem(); // menuItem.InitiateSettings(null); // SetMenuValue(menuItem, menuItemNode); // menuItem.Click += new EventHandler(FormDesigner.eventManager.handleMenuItemClick); // //menuItem.ControlName = menuItem.Name; // menuBar.CurrentMenu.DropDownItems.Add(menuItem); // menuBar.CurrentMenu.CurrentMenuItem = menuItem; // //to deserialise the evnts related to menu items // SetEIBEventsValue(menuItem, menuItemNode); // } // } //} }
private static void SetDataMappingValue(IEIBControl control, XmlNode xmlNode) { XmlNode xmlChildNode = xmlNode.SelectSingleNode(XMLServicesConstants.xmlDataMappings); if (xmlChildNode != null) { foreach (XmlNode childXmlNode in xmlChildNode.ChildNodes) { if (childXmlNode.NodeType == XmlNodeType.Element) { if (childXmlNode.Name == XMLServicesConstants.xmlMappings) { int attributeCount = childXmlNode.Attributes.Count; if (attributeCount > 0) { string dataFieldName="", dataTableName="", dataPatternName=""; XmlAttribute dataFieldAtt = childXmlNode.Attributes[XMLServicesConstants.XmlNodeDataFieldAtt]; if (dataFieldAtt != null) { dataFieldName = dataFieldAtt.Value; } XmlAttribute dataPatternAtt = childXmlNode.Attributes[XMLServicesConstants.XmlNodeDataPatternAtt]; if (dataPatternAtt != null) { dataPatternName = dataPatternAtt.Value; } XmlAttribute dataTableAtt = childXmlNode.Attributes[XMLServicesConstants.XmlNodeDataTableAtt]; if (dataTableAtt != null) { dataTableName = dataTableAtt.Value; } DataMapping dataMapping = new DataMapping(dataPatternName, dataTableName, dataFieldName); if (control.DataMappings == null) { control.DataMappings = new List<DataMapping>(); } control.DataMappings.Add(dataMapping); } } } } } }
private static void SetEIBAttributeValue(IEIBControl node, string propertyName, string value) { if (propertyName == XMLServicesConstants.XmlNodeNameAtt) { node.ControlName = value; } /*if (propertyName == XMLServicesConstants.XmlNodeDataFieldAtt) { node.DataFieldName = value; } if (propertyName == XMLServicesConstants.XmlNodeDataPatternAtt) { node.DataPatternName = value; } if (propertyName == XMLServicesConstants.XmlNodeDataTableAtt) { node.DataTableName = value; }*/ if (propertyName == XMLServicesConstants.XmlNodeIsMandatoryAtt) { node.IsMandatory = value; } if (propertyName == XMLServicesConstants.XmlNodeDraggableAtt) { node.Draggable = value.ToLower().Equals("true"); } if (propertyName == XMLServicesConstants.XmlNodeDroppableAtt) { node.Droppable = value.ToLower().Equals("true"); } }
public DeleteControlMemento(IEIBControl control, IEIBControl parent, EIBFormDesigner.Designer.BaseWindow basewin) { controlToDelete = control; parentControl = parent; this.baseWindow = basewin; }
private static void SetEIBAttributeValue(IEIBControl node, string propertyName, string value) { if (propertyName == XMLServicesConstants.XmlNodeNameAtt) { node.ControlName = value; } if (propertyName == XMLServicesConstants.XmlNodeIdAtt) { if (node is EIBTextBox) { ((EIBTextBox)node).UniqueId = value; } else if (node is EIBButton) { ((EIBButton)node).UniqueId = value; } else if(node is EIBLabel) { ((EIBLabel)node).UniqueId = value; } else if (node is EIBCombobox) { ((EIBCombobox)node).UniqueId = value; } else if (node is EIBApplet) { ((EIBApplet)node).UniqueId = value; } else if (node is EIBBrowse) { ((EIBBrowse)node).UniqueId = value; } else if (node is EIBCalender) { ((EIBCalender)node).UniqueId = value; } else if (node is EIBCheckbox) { ((EIBCheckbox)node).UniqueId = value; } else if (node is EIBDatePicker) { ((EIBDatePicker)node).UniqueId = value; } else if (node is EIBGrid) { ((EIBGrid)node).UniqueId = value; } else if (node is EIBImageBrowse) { ((EIBImageBrowse)node).UniqueId = value; } else if (node is EIBJasper) { ((EIBJasper)node).UniqueId = value; } else if (node is EIBLattice) { ((EIBLattice)node).UniqueId = value; } else if (node is EIBListbox) { ((EIBListbox)node).UniqueId = value; } else if (node is EIBMenu) { ((EIBMenu)node).UniqueId = value; } //else if (node is EIBMenuBar) //{ // ((EIBMenuBar)node).UniqueId = value; //} else if (node is EIBPaging) { ((EIBPaging)node).UniqueId = value; } else if (node is EIBPicture) { ((EIBPicture)node).UniqueId = value; } else if (node is EIBPlaceHolder) { ((EIBPlaceHolder)node).UniqueId = value; } else if (node is EIBRadioButton) { ((EIBRadioButton)node).UniqueId = value; } else if (node is EIBRadioGroup) { ((EIBRadioGroup)node).UniqueId = value; } else if (node is EIBScrollableRow) { ((EIBScrollableRow)node).UniqueId = value; } else if (node is EIBSchedular) { ((EIBSchedular)node).UniqueId = value; } else if (node is EIBSearch) { ((EIBSearch)node).UniqueId = value; } else if (node is EIBTabControl) { ((EIBTabControl)node).UniqueId = value; } else if (node is EIBTabPage) { ((EIBTabPage)node).UniqueId = value; } else if (node is EIBTime) { ((EIBTime)node).UniqueId = value; } else if (node is EIBTreeView) { ((EIBTreeView)node).UniqueId = value; } else if (node is EIBTreeNode) { ((EIBTreeNode)node).UniqueId = value; } } if (propertyName == XMLServicesConstants.XmlNodeIdAtt) { } /*if (propertyName == XMLServicesConstants.XmlNodeDataFieldAtt) { node.DataFieldName = value; } if (propertyName == XMLServicesConstants.XmlNodeDataPatternAtt) { node.DataPatternName = value; } if (propertyName == XMLServicesConstants.XmlNodeDataTableAtt) { node.DataTableName = value; }*/ if (propertyName == XMLServicesConstants.XmlNodeIsMandatoryAtt) { node.IsMandatory = value; } if (propertyName == XMLServicesConstants.XmlNodeDraggableAtt) { node.Draggable = value.ToLower().Equals("true"); } if (propertyName == XMLServicesConstants.XmlNodeDroppableAtt) { node.Droppable = value.ToLower().Equals("true"); } if (propertyName == XMLServicesConstants.XmlNodeStyleAtt) { if (node is EIBPanel) { ((EIBPanel)node).Style = value; } else if (node is EIBTextBox) { ((EIBTextBox)node).Style = value; } } if (propertyName == XMLServicesConstants.XmlNodeRenderAsIFrameAtt) { ((EIBPanel)node).RenderAsIFrame = value.ToLower().Equals("true"); } if (propertyName == XMLServicesConstants.XmlNodeUseDefaultColorAtt) { if (node is EIBGrid) { ((EIBGrid)node).UseDefaultColor = value.ToLower().Equals("true"); } else if (node is EIBButton) { ((EIBButton)node).UseDefaultColor = value.ToLower().Equals("true"); } } if (propertyName == XMLServicesConstants.XmlNodeCheckmarkAtt) { if (node is EIBGrid) { ((EIBGrid)node).Checkmark = value.ToLower().Equals("true"); } else if (node is EIBListbox) { ((EIBListbox)node).Checkmark = value.ToLower().Equals("true"); } } if (propertyName == XMLServicesConstants.XmlNodeAutoScroll) { if (node is EIBGrid) { ((EIBGrid)node).AutoScroll = value.ToLower().Equals("true"); } else if (node is EIBPanel) { ((EIBPanel)node).AutoScroll = value.ToLower().Equals("true"); } } if (propertyName == XMLServicesConstants.XmlNodeGridTypeAtt) { if (node is EIBGrid) { if (value == GridType.ListBox.ToString()) { ((EIBGrid)node).GridType = GridType.ListBox; } else if (value == GridType.Grid.ToString()) { ((EIBGrid)node).GridType = GridType.Grid; } } } if (propertyName == XMLServicesConstants.XmlNodeRoundedMoldAtt) { if (node is EIBCombobox) { if (value == MoldType.Default.ToString()) { ((EIBCombobox)node).Mold = MoldType.Default; } else if (value == MoldType.Rounded.ToString()) { ((EIBCombobox)node).Mold = MoldType.Rounded; } } else if (node is EIBTextBox) { if (value == MoldType.Default.ToString()) { ((EIBTextBox)node).Mold = MoldType.Default; } else if (value == MoldType.Rounded.ToString()) { ((EIBTextBox)node).Mold = MoldType.Rounded; } } } }
public void displayFormulaProperties(FormulaEditorWindow form, IEIBControl controlObject) { try { form.designTree.Nodes[0].Nodes.RemoveByKey("OnCheck"); form.designTree.Nodes[0].Nodes.RemoveByKey("GlobalScripts"); form.designTree.Nodes[0].Nodes.RemoveByKey("OnOpen"); form.designTree.Nodes[0].Nodes.RemoveByKey("OnSelect"); form.designTree.Nodes[0].Nodes.RemoveByKey("OnChanging"); if (controlObject is EIBCheckbox) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnCheck")) { System.Windows.Forms.TreeNode treeNode_onCheck = new System.Windows.Forms.TreeNode("OnCheck"); treeNode_onCheck.Name = "OnCheck"; form.designTree.Nodes[0].Nodes.Add(treeNode_onCheck); } } if (controlObject is EIBPanel) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("GlobalScripts")) { System.Windows.Forms.TreeNode treeNode_globalScripts = new System.Windows.Forms.TreeNode("GlobalScripts"); treeNode_globalScripts.Name = "GlobalScripts"; form.designTree.Nodes[0].Nodes.Add(treeNode_globalScripts); } } if (controlObject is EIBTreeNode) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnOpen")) { System.Windows.Forms.TreeNode treeNode_onOpen = new System.Windows.Forms.TreeNode("OnOpen"); treeNode_onOpen.Name = "OnOpen"; form.designTree.Nodes[0].Nodes.Add(treeNode_onOpen); } } if (controlObject is EIBTreeView) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnSelect")) { System.Windows.Forms.TreeNode treeNode_onSelect = new System.Windows.Forms.TreeNode("OnSelect"); treeNode_onSelect.Name = "OnSelect"; form.designTree.Nodes[0].Nodes.Add(treeNode_onSelect); } } if (controlObject is EIBGrid) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnSelect")) { System.Windows.Forms.TreeNode treeNode_onSelect = new System.Windows.Forms.TreeNode("OnSelect"); treeNode_onSelect.Name = "OnSelect"; form.designTree.Nodes[0].Nodes.Add(treeNode_onSelect); } } if (controlObject is EIBCombobox) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnChanging")) { System.Windows.Forms.TreeNode treeNode_onChanging = new System.Windows.Forms.TreeNode("OnChanging"); treeNode_onChanging.Name = "OnChanging"; form.designTree.Nodes[0].Nodes.Add(treeNode_onChanging); } if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnOpen")) { System.Windows.Forms.TreeNode treeNode_onOpen = new System.Windows.Forms.TreeNode("OnOpen"); treeNode_onOpen.Name = "OnOpen"; form.designTree.Nodes[0].Nodes.Add(treeNode_onOpen); } } if (controlObject is EIBTextBox) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnChanging")) { System.Windows.Forms.TreeNode treeNode_onChanging = new System.Windows.Forms.TreeNode("OnChanging"); treeNode_onChanging.Name = "OnChanging"; form.designTree.Nodes[0].Nodes.Add(treeNode_onChanging); } } if (form.SelectedNode != null) { if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.DefaultValue)) { form.formulaText.Text = controlObject.DefaultValue; } if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnClick)) { form.formulaText.Text = controlObject.OnClickValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.Exiting)) { form.formulaText.Text = controlObject.ExitingValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.Entering)) { form.formulaText.Text = controlObject.EnteringValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnDoubleClick)) { form.formulaText.Text = controlObject.OnDoubleClick; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnDrop)) { form.formulaText.Text = controlObject.OnDrop; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnFocus)) { form.formulaText.Text = controlObject.OnFocus; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnBlur)) { form.formulaText.Text = controlObject.OnBlur; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnEventCreate)) { form.formulaText.Text = controlObject.OnEventCreateValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnEventEdit)) { form.formulaText.Text = controlObject.OnEventEditValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnEventUpdate)) { form.formulaText.Text = controlObject.OnEventUpdateValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnChange)) { form.formulaText.Text = controlObject.OnChange; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnOK)) { form.formulaText.Text = controlObject.OnOK; } } } catch (Exception exp) { Console.Write(exp.StackTrace); } }
public static string UpdateMenuIcon(IEIBControl control, string uniqueId) { Image pictureImage = null; string sourceImage = null; if (control is EIBMenuBar) { pictureImage = ((EIBMenuBar)control).MenuIcon; sourceImage = "\\img\\" + ((EIBMenuBar)control).UniqueId + ".jpg"; } else if (control is EIBVMenuBar) { pictureImage = ((EIBVMenuBar)control).MenuIcon; sourceImage = "\\img\\" + ((EIBVMenuBar)control).UniqueId + ".jpg"; } else if (control is EIBMenu) { pictureImage = ((EIBMenu)control).MenuIcon; sourceImage = "\\img\\" + ((EIBMenu)control).UniqueId + ".jpg"; } else if (control is EIBMenuItem) { pictureImage = ((EIBMenuItem)control).MenuIcon; sourceImage = "\\img\\" + ((EIBMenuItem)control).UniqueId + ".jpg"; } bool isChanged = true; try { if (pictureImage != null) { int[] aPropertyIdList = pictureImage.PropertyIdList; } } catch { isChanged = false; } if (sourceImage != null && pictureImage != null) { //string sourceImage = "\\img\\" + ((IEIBControl)control).ControlName + ".jpg"; String curDir = Directory.GetCurrentDirectory(); if (!Directory.Exists(EIBXMLUtilities.folderName + "\\img\\")) { Directory.CreateDirectory(EIBXMLUtilities.folderName + "\\img\\"); } try { if (isChanged) { pictureImage.Save(EIBXMLUtilities.folderName + sourceImage, pictureImage.RawFormat); } } catch (Exception) { } return sourceImage; } return null; }
private void saveFormula_Click(object sender, EventArgs e) { try { currentBaseWindow = form.currentBaseWindow; IEIBControl control = form.currentBaseWindow.CurrentControl[0]; //this.parserError.Text = ""; if (errorWriter != null) { errorWriter.Dispose(); } errorWriter = new StringWriter(); //if (!formulaText.Text.Trim().Equals("") && !(selectedNode.Name.Trim().Equals(FormDesignerConstants.GlobalScripts))) //{ // //Parse the text to Validate the user input formula // Scanner scanner = new Scanner(formulaText.Text); // Parser parser = new Parser(scanner); // parser.errors.errorStream = errorWriter; // parser.Parse(); // TextReader stringReader = new StringReader(errorWriter.ToString()); // this.parserError.Text = stringReader.ReadToEnd(); // Console.Write(parser.errors.count + " errors detected"); // if (parser.errors.count > 0) // { // return; // } //} if (currentBaseWindow != null && selectedNode != null && currentBaseWindow.CurrentControl != null) { if (selectedNode.Name.Trim().Equals(FormDesignerConstants.DefaultValue)) { currentBaseWindow.CurrentControl[0].DefaultValue = formulaText.Text; } if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnClick)) { currentBaseWindow.CurrentControl[0].OnClickValue = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.Exiting)) { currentBaseWindow.CurrentControl[0].ExitingValue = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.Entering)) { currentBaseWindow.CurrentControl[0].EnteringValue = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnDoubleClick)) { currentBaseWindow.CurrentControl[0].OnDoubleClick = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnDrop)) { currentBaseWindow.CurrentControl[0].OnDrop = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnFocus)) { currentBaseWindow.CurrentControl[0].OnFocus = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnBlur)) { currentBaseWindow.CurrentControl[0].OnBlur = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnEventCreate)) { currentBaseWindow.CurrentControl[0].OnEventCreateValue = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnEventEdit)) { currentBaseWindow.CurrentControl[0].OnEventEditValue = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnEventUpdate)) { currentBaseWindow.CurrentControl[0].OnEventUpdateValue = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnChange)) { currentBaseWindow.CurrentControl[0].OnChange = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnOK)) { currentBaseWindow.CurrentControl[0].OnOK = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.GlobalScripts)) { ((EIBPanel)control).GlobalScripts = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnCheck)) { ((EIBCheckbox)control).OnCheck = formulaText.Text; } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnOpen)) { if (control is EIBTreeNode) { ((EIBTreeNode)control).OnOpen = formulaText.Text; } else if (control is EIBCombobox) { ((EIBCombobox)control).OnOpen = formulaText.Text; } } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnSelect)) { if (control is EIBTreeView) { ((EIBTreeView)control).OnSelect = formulaText.Text; } else if (control is EIBGrid) { ((EIBGrid)control).OnSelect = formulaText.Text; } } else if (selectedNode.Name.Trim().Equals(FormDesignerConstants.OnChanging)) { if (control is EIBTextBox) { ((EIBTextBox)control).OnChanging = formulaText.Text; } else if (control is EIBCombobox) { ((EIBCombobox)control).OnChanging = formulaText.Text; } } } } catch (Exception ex) { String errStr = "Error saving event: " + ex.Message + "\r\n"; MessageBox.Show(errStr); } }
// This method deserialize the EIB events associated with the control from // XML document. Look into all event nodes and check for associated event // name private static void SetEIBEventsValue(IEIBControl control, XmlNode xmlNode) { foreach (XmlNode childXmlNode in xmlNode.ChildNodes) { if (childXmlNode.NodeType == XmlNodeType.Element) { if (childXmlNode.Name == XMLServicesConstants.XmlNodeEventsElt) { foreach (XmlNode childEventXmlNode in childXmlNode.ChildNodes) { int attributeCount = childEventXmlNode.Attributes.Count; if (attributeCount > 0 && childEventXmlNode.Attributes["internal"] == null) { for (int counter = 0; counter < attributeCount; counter++) { if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnClickElt.ToLower()) { control.OnClickValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnDoubleClickElt.ToLower()) { control.OnDoubleClick = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeEnteringElt.ToLower()) { control.EnteringValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeExitingElt) { control.ExitingValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeDefaultValueElt.ToLower()) { control.DefaultValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnDropElt.ToLower()) { control.OnDrop = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnFocusElt.ToLower()) { control.OnFocus = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnBlurElt.ToLower()) { control.OnBlur = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnEventCreateElt.ToLower()) { control.OnEventCreateValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnEventEditElt.ToLower()) { control.OnEventEditValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnEventUpdateElt.ToLower()) { control.OnEventUpdateValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnChangeElt.ToLower()) { control.OnChange = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnOKElt.ToLower()) { control.OnOK = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeGlobalScriptsElt.ToLower()) { ((EIBPanel)control).GlobalScripts = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnCheckElt.ToLower()) { ((EIBCheckbox)control).OnCheck = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnOpenElt.ToLower()) { if (control is EIBTreeNode) { ((EIBTreeNode)control).OnOpen = childEventXmlNode.InnerText; } else if (control is EIBCombobox) { ((EIBCombobox)control).OnOpen = childEventXmlNode.InnerText; } } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnSelectElt.ToLower()) { if (control is EIBTreeView) { ((EIBTreeView)control).OnSelect = childEventXmlNode.InnerText; } else if (control is EIBGrid) { ((EIBGrid)control).OnSelect = childEventXmlNode.InnerText; } } if (childEventXmlNode.Attributes[counter].Value.ToLower() == XMLServicesConstants.XmlNodeOnChangingElt.ToLower()) { if (control is EIBCombobox) { ((EIBCombobox)control).OnChanging = childEventXmlNode.InnerText; } else if (control is EIBTextBox) { ((EIBTextBox)control).OnChanging = childEventXmlNode.InnerText; } } } } } } } } }
// This method deserialize the EIB events associated with the control from // XML document. Look into all event nodes and check for associated event // name private static void SetEIBEventsValue(IEIBControl control, XmlNode xmlNode) { foreach (XmlNode childXmlNode in xmlNode.ChildNodes) { if (childXmlNode.NodeType == XmlNodeType.Element) { if (childXmlNode.Name == XMLServicesConstants.XmlNodeEventsElt) { foreach (XmlNode childEventXmlNode in childXmlNode.ChildNodes) { int attributeCount = childEventXmlNode.Attributes.Count; if (attributeCount > 0 && childEventXmlNode.Attributes["internal"] == null) { for (int counter = 0; counter < attributeCount; counter++) { if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeOnClickElt) { control.OnClickValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeOnDoubleClickElt) { control.OnDoubleClick = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeEnteringElt) { control.EnteringValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeExitingElt) { control.ExitingValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeDefaultValueElt) { control.DefaultValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeOnDropElt) { control.OnDrop = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeOnFocusElt) { control.OnFocus = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeOnBlurElt) { control.OnBlur = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeOnEventCreateElt) { control.OnEventCreateValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeOnEventEditElt) { control.OnEventEditValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeOnEventUpdateElt) { control.OnEventUpdateValue = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeOnChangeElt) { control.OnChange = childEventXmlNode.InnerText; } if (childEventXmlNode.Attributes[counter].Value == XMLServicesConstants.XmlNodeOnOKElt) { control.OnOK = childEventXmlNode.InnerText; } } } } } } } }
public static void RefreshInList(IEIBControl control) { if (control is EIBMenuBar) { if (!EIBControlCollection.MenuBarlist.ContainsKey(((Control)control).Name)) { EIBControlCollection.MenuBarlist.Add(((Control)control).Name, ((Control)control).Name); } foreach (EIBMenu menu in ((ToolStrip)((EIBMenuBar)control).Controls[0]).Items) { RefreshInList(menu); } } if (control is EIBMenu) { if (!EIBControlCollection.Menulist.ContainsKey(((ToolStripItem)control).Name)) { EIBControlCollection.Menulist.Add(((ToolStripItem)control).Name, ((ToolStripItem)control).Name); } foreach (IEIBControl menuControl in ((EIBMenu)control).DropDownItems) { RefreshInList(menuControl); } } if (control is EIBMenuItem) { if (!EIBControlCollection.MenuItemlist.ContainsKey(((ToolStripItem)control).Name)) { EIBControlCollection.MenuItemlist.Add(((ToolStripItem)control).Name, ((ToolStripItem)control).Name); } } }
public void deleteFromControlCollections(IEIBControl ctrlToDelete) { if (ctrlToDelete is Control) { foreach (object ctrl in ((Control)ctrlToDelete).Controls) { if (ctrl is IEIBControl) { deleteFromControlCollections((IEIBControl)ctrl); } } } string Name = ""; if (ctrlToDelete.GetType().GetInterface(typeof(IEIBControl).Name) != null) { PropertyInfo propertyInfo = ctrlToDelete.GetType().GetProperty("Name"); if (propertyInfo != null) { Name = (string)propertyInfo.GetGetMethod().Invoke(ctrlToDelete, null); } } if (!string.IsNullOrEmpty(Name)) { if (ctrlToDelete is EIBTextBox) { if (EIBControlCollection.TextBoxlist.ContainsKey(Name)) { EIBControlCollection.TextBoxlist.Remove(Name); } } else if (ctrlToDelete is EIBTreeNode) { if (EIBControlCollection.TreeNodelist.ContainsKey(Name)) { EIBControlCollection.TreeNodelist.Remove(Name); } } else if (ctrlToDelete is EIBTreeView) { if (EIBControlCollection.TreeViewlist.ContainsKey(Name)) { foreach (TreeNode ctrl in ((TreeView)ctrlToDelete).Nodes) { if (ctrl is IEIBControl) { deleteFromControlCollections((IEIBControl)ctrl); } } EIBControlCollection.TreeViewlist.Remove(Name); } } else if (ctrlToDelete is EIBMenu) { if (EIBControlCollection.Menulist.ContainsKey(Name)) { EIBControlCollection.Menulist.Remove(Name); } } else if (ctrlToDelete is EIBMenuItem) { if (EIBControlCollection.MenuItemlist.ContainsKey(Name)) { EIBControlCollection.MenuItemlist.Remove(Name); } } else if (ctrlToDelete is EIBMenuBar) { if (EIBControlCollection.MenuBarlist.ContainsKey(Name)) { EIBControlCollection.MenuBarlist.Remove(Name); } } else if (ctrlToDelete is EIBTabPage) { if (EIBControlCollection.TabPagelist.ContainsKey(Name)) { EIBControlCollection.TabPagelist.Remove(Name); } } else if (ctrlToDelete is EIBPaging) { if (EIBControlCollection.Paginglist.ContainsKey(Name)) { foreach (IEIBControl control in loadGridAndListBoxList().Values) { if (control is EIBGrid) { if (((EIBGrid)control).Paginal == Name) { ((EIBGrid)control).Paginal = null; } } if (control is EIBLattice) { if (((EIBLattice)control).Paginal == Name) { ((EIBLattice)control).Paginal = null; } } else if (control is EIBListbox) { if (((EIBListbox)control).Paginal == Name) { ((EIBListbox)control).Paginal = null; } } } EIBControlCollection.Paginglist.Remove(Name); } } } }
//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 { } }
public void displayFormulaProperties(FormulaEditorWindow form, IEIBControl controlObject) { try { form.designTree.Nodes[0].Nodes.RemoveByKey("OnCheck"); form.designTree.Nodes[0].Nodes.RemoveByKey("GlobalScripts"); form.designTree.Nodes[0].Nodes.RemoveByKey("OnOpen"); form.designTree.Nodes[0].Nodes.RemoveByKey("OnSelect"); form.designTree.Nodes[0].Nodes.RemoveByKey("OnChanging"); if (controlObject is EIBCheckbox) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnCheck")) { System.Windows.Forms.TreeNode treeNode_onCheck = new System.Windows.Forms.TreeNode("OnCheck"); treeNode_onCheck.Name = "OnCheck"; form.designTree.Nodes[0].Nodes.Add(treeNode_onCheck); } } if (controlObject is EIBPanel) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("GlobalScripts")) { System.Windows.Forms.TreeNode treeNode_globalScripts = new System.Windows.Forms.TreeNode("GlobalScripts"); treeNode_globalScripts.Name = "GlobalScripts"; form.designTree.Nodes[0].Nodes.Add(treeNode_globalScripts); } } if (controlObject is EIBTreeNode) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnOpen")) { System.Windows.Forms.TreeNode treeNode_onOpen = new System.Windows.Forms.TreeNode("OnOpen"); treeNode_onOpen.Name = "OnOpen"; form.designTree.Nodes[0].Nodes.Add(treeNode_onOpen); } } if (controlObject is EIBTreeView) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnSelect")) { System.Windows.Forms.TreeNode treeNode_onSelect = new System.Windows.Forms.TreeNode("OnSelect"); treeNode_onSelect.Name = "OnSelect"; form.designTree.Nodes[0].Nodes.Add(treeNode_onSelect); } } if (controlObject is EIBGrid) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnSelect")) { System.Windows.Forms.TreeNode treeNode_onSelect = new System.Windows.Forms.TreeNode("OnSelect"); treeNode_onSelect.Name = "OnSelect"; form.designTree.Nodes[0].Nodes.Add(treeNode_onSelect); } } if (controlObject is EIBCombobox) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnChanging")) { System.Windows.Forms.TreeNode treeNode_onChanging = new System.Windows.Forms.TreeNode("OnChanging"); treeNode_onChanging.Name = "OnChanging"; form.designTree.Nodes[0].Nodes.Add(treeNode_onChanging); } if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnOpen")) { System.Windows.Forms.TreeNode treeNode_onOpen = new System.Windows.Forms.TreeNode("OnOpen"); treeNode_onOpen.Name = "OnOpen"; form.designTree.Nodes[0].Nodes.Add(treeNode_onOpen); } } if (controlObject is EIBTextBox) { if (!form.designTree.Nodes[0].Nodes.ContainsKey("OnChanging")) { System.Windows.Forms.TreeNode treeNode_onChanging = new System.Windows.Forms.TreeNode("OnChanging"); treeNode_onChanging.Name = "OnChanging"; form.designTree.Nodes[0].Nodes.Add(treeNode_onChanging); } } if (form.SelectedNode != null) { if(form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.DefaultValue)) { form.formulaText.Text = controlObject.DefaultValue; } if(form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnClick)) { form.formulaText.Text = controlObject.OnClickValue; } else if(form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.Exiting)) { form.formulaText.Text = controlObject.ExitingValue; } else if(form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.Entering)) { form.formulaText.Text = controlObject.EnteringValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnDoubleClick)) { form.formulaText.Text = controlObject.OnDoubleClick; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnDrop)) { form.formulaText.Text = controlObject.OnDrop; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnFocus)) { form.formulaText.Text = controlObject.OnFocus; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnBlur)) { form.formulaText.Text = controlObject.OnBlur; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnEventCreate)) { form.formulaText.Text = controlObject.OnEventCreateValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnEventEdit)) { form.formulaText.Text = controlObject.OnEventEditValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnEventUpdate)) { form.formulaText.Text = controlObject.OnEventUpdateValue; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnChange)) { form.formulaText.Text = controlObject.OnChange; } else if (form.SelectedNode.Name.Trim().Equals(FormDesignerConstants.OnOK)) { form.formulaText.Text = controlObject.OnOK; } } } catch (Exception exp) { Console.Write(exp.StackTrace); } }