internal void saveToolStripMenuItem_Click(object sender, EventArgs e) { try { if (EIBXMLUtilities.folderName != null && !EIBXMLUtilities.folderName.Trim().Equals("")) { BaseWindow prevBaseWindow = this.currentBaseWindow; if (prevBaseWindow != null) { eventManager.handleControlClick(prevBaseWindow.baseFrame, new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0)); } formDesignerUtility.save(this, applicationDoc); projectExplorer.initExplorer(); dataPatternExplorer.initExplorer(); PickBox.isctrlpressed = false; this.currentBaseWindow.CurrentControl.Clear(); if (prevBaseWindow != null && !prevBaseWindow.IsDisposed) { if (prevBaseWindow.Visible) { this.currentBaseWindow = prevBaseWindow; this.currentBaseWindow.Show(dockPanel); this.currentBaseWindow.Select(); } } setFromPatternsForACL(); } } catch { } }
private void dockPanel_ActiveDocumentChanged(object sender, EventArgs e) { if (dockPanel.ActiveDocument != null && dockPanel.ActiveDocument.GetType() == typeof(BaseWindow)) { projectExplorer.changeProjectItemSelection(((ToolWindow)dockPanel.ActiveDocument).Text, ((BaseWindow)dockPanel.ActiveDocument).TypeOfWindow); propertyWindow.propertyGrid.SelectedObject = ((BaseWindow)dockPanel.ActiveDocument).baseFrame; dbSettings.CurrentBaseWindow = (BaseWindow)dockPanel.ActiveDocument; currentBaseWindow = (BaseWindow)dockPanel.ActiveDocument; if (((BaseWindow)dockPanel.ActiveDocument).TypeOfWindow == FormDesignerConstants.FormPattern) { displayNameExplorer.initExplorer(); displayNameExplorer.comboBox1.SelectedText = ""; UIEventManager.ContextMenu.MenuItems[0].Enabled = true; UIEventManager.ContextMenu.MenuItems[2].Enabled = true; UIEventManager.ContextMenu.MenuItems[3].Enabled = true; } else if (((BaseWindow)dockPanel.ActiveDocument).TypeOfWindow == FormDesignerConstants.DataPattern) { UIEventManager.ContextMenu.MenuItems[0].Enabled = false; UIEventManager.ContextMenu.MenuItems[2].Enabled = false; UIEventManager.ContextMenu.MenuItems[3].Enabled = false; } else if (((BaseWindow)dockPanel.ActiveDocument).TypeOfWindow == FormDesignerConstants.WorkflowPattern) { UIEventManager.ContextMenu.MenuItems[0].Enabled = false; UIEventManager.ContextMenu.MenuItems[2].Enabled = false; UIEventManager.ContextMenu.MenuItems[3].Enabled = false; } } }
public static void Add_toSchema(string datasetName,string fileName,BaseWindow baseWindow) { XmlDocument oXMLschema; XmlAttribute oAtt1; //load dataset schema into xml oXMLschema = new XmlDocument(); oXMLschema.LoadXml(File.ReadAllText(fileName)); //modify the xml schema. XmlNamespaceManager nmsMgr = new XmlNamespaceManager(oXMLschema.NameTable); nmsMgr.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema"); string xpath_toEle_inDSschema = "/"+datasetName+"/xs:schema/xs:element/xs:complexType/xs:choice/xs:element"; XmlNodeList oNList = oXMLschema.SelectNodes( xpath_toEle_inDSschema, nmsMgr); foreach (XmlNode oN in oNList) { string name = oN.Attributes["name"].Value; int tableIndex = baseWindow.baseFrame.Controls.IndexOfKey(name); if (tableIndex >= 0) { oAtt1 = oXMLschema.CreateAttribute("M2M"); if (((EIBTable)baseWindow.baseFrame.Controls[tableIndex]).M2M) { oAtt1.Value = "Yes"; } else { oAtt1.Value = "No"; } oN.Attributes.Append(oAtt1); } } oXMLschema.Save(fileName); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { try { OpenScenario scb = new OpenScenario(); if (scb.ShowDialog() == DialogResult.OK) { DialogResult result = DialogResult.OK; if (!EIBXMLUtilities.projectFilePath.Trim().Equals("")) { result = MessageBox.Show("Do you want to exit from Current Project", "Exit Project", MessageBoxButtons.OKCancel); } if (result == DialogResult.OK) { foreach (BaseWindow baseWindow in FormDesigner.listBaseWindow) { baseWindow.Close(); } FormDesigner.listFormBaseWindow.Clear(); FormDesigner.listBaseWindow.Clear(); FormDesigner.listDataBaseWindow.Clear(); FormDesigner.listWorkBaseWindow.Clear(); FormDesignerUtilities.visibleTrueWindow.Clear(); EIBXMLUtilities.projectFilePath = scb.projectLocation.Text; //Read Manifest File and Update Everything DirectoryInfo directory = new DirectoryInfo(EIBXMLUtilities.projectFilePath); string directoryPath = ""; while (directory.Parent != null) { directoryPath = "\\" + directory.Parent + directoryPath; directory = directory.Parent; } EIBXMLUtilities.folderName = directory.Root.Name + directoryPath; NameFolderStructure(); formDesignerUtility.openProjectSettings(applicationDoc); displayNameExplorer.formPatternMapList.Clear(); toolBoxToolStripMenuItem_Click(null, null); datapatternExplorerToolStripMenuItem_Click(null, null); propertyEditorToolStripMenuItem_Click(null, null); projectExplorerToolStripMenuItem_Click(null, null); this.toolBoxWindow.tabControl.SelectedIndex = 0; this.Text = EIBXMLUtilities.projectName + " - Application Designer"; this.buildToolStripMenuItem1.Enabled = true; this.MakePublish(false); //AccessControlList.createRightXml(); //AccessControlList.loadRightXml(); useradminutility = UserAdminUtilities.UserAdminUtility; //UserAdminUtilities.Refresh(); UserAdminUtilities.UserAdminUtility.Users.Clear(); UserAdminUtilities.UserAdminUtility.Roles.Clear(); UserAdminUtilities.UserAdminUtility.UserPatterns.Clear(); useradminutility.Desearilize(); setFromPatternsForACL(); webServiceExplorer.DeSerializeXMLMappings(); this.currentBaseWindow = null; if (scb.liferayChckBx.Checked) { LiferayWindow lfr = new LiferayWindow(); lfr.ShowDialog(); } } } } catch (Exception err) { Console.WriteLine(err.Message); } }
public BaseWindow initBaseWindow(string typeOfWindow, string windowName, bool isWindowSaved) { try { if (typeOfWindow == FormDesignerConstants.FormPattern) { //Check for new Window if (windowName == null) { windowName = ""; currentBaseWindow = new BaseWindow(typeOfWindow, windowName, isWindowSaved); windowName = currentBaseWindow.baseFrame.ControlName; listFormBaseWindow.Add(currentBaseWindow.baseFrame.ControlName, currentBaseWindow); listBaseWindow.Add(currentBaseWindow); DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true); } //Check if we already create this object so no need to create new one else if (!listFormBaseWindow.ContainsKey(windowName)) { //currentBaseWindow.baseFrame.DataBindings.Add("ControlName",FormDesignerUtilities.dataSetList["datapattern0"]); currentBaseWindow = new BaseWindow(typeOfWindow, windowName, isWindowSaved); listFormBaseWindow.Add(currentBaseWindow.baseFrame.ControlName, currentBaseWindow); listBaseWindow.Add(currentBaseWindow); DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true); } else { currentBaseWindow = listFormBaseWindow[windowName]; } } if (typeOfWindow == FormDesignerConstants.DataPattern) { if (windowName == null) { windowName = ""; } if (!listDataBaseWindow.ContainsKey(windowName)) { currentBaseWindow = new BaseWindow(typeOfWindow, windowName, isWindowSaved); listDataBaseWindow.Add(currentBaseWindow.baseFrame.ControlName, currentBaseWindow); listBaseWindow.Add(currentBaseWindow); DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true); } else { currentBaseWindow = listDataBaseWindow[windowName]; } } if (typeOfWindow == FormDesignerConstants.WorkflowPattern) { if (windowName == null) { windowName = ""; } if (!listWorkBaseWindow.ContainsKey(windowName)) { currentBaseWindow = new BaseWindow(typeOfWindow, windowName, isWindowSaved); listWorkBaseWindow.Add(currentBaseWindow.baseFrame.ControlName, currentBaseWindow); listBaseWindow.Add(currentBaseWindow); DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true); } else { currentBaseWindow = listWorkBaseWindow[windowName]; } } currentBaseWindow.TypeOfWindow = typeOfWindow; formulaEditor.CurrentBaseWindow = currentBaseWindow; currentBaseWindow.Click += new EventHandler(currentBaseWindow_Click); currentBaseWindow.KeyPreview = true; if (!currentBaseWindow.isKeyDown) { currentBaseWindow.KeyDown += new KeyEventHandler(eventManager.HandleCtrlDown); currentBaseWindow.KeyUp += new KeyEventHandler(eventManager.HandleCtrlUp); currentBaseWindow.KeyPress += new KeyPressEventHandler(eventManager.HandleKeyPress); currentBaseWindow.isKeyDown = true; } /*Register it only for one time*/ //DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true); //baseWindowDefaultToolClick(null, null); currentBaseWindow.MouseClick += new MouseEventHandler(eventManager.handleControlClick); if (!currentBaseWindow.baseFrame.isMouseClick) { currentBaseWindow.baseFrame.MouseClick += new MouseEventHandler(eventManager.handleControlClick); currentBaseWindow.baseFrame.isMouseClick = true; } //currentBaseWindow.SizeChanged += new EventHandler(currentBaseWindow_SizeChanged); currentBaseWindow.baseFrame.Scroll += new ScrollEventHandler(baseFrame_Scroll); currentBaseWindow.baseFrame.MouseWheel += new MouseEventHandler(baseFrame_MouseWheel); UIEventManager.form.currentBaseWindow = currentBaseWindow; FormulaEditorWindow.form.currentBaseWindow = currentBaseWindow; //Added by HKU to set the first form pattern as default screen if (currentBaseWindow.TypeOfWindow == FormDesignerConstants.FormPattern) { if (currentBaseWindow != null) { if (listFormBaseWindow.Count == 1 && FormDesignerUtilities.visibleTrueWindow.Count < 1) { currentBaseWindow.baseFrame.DefaultScreen = true; } } } //Adding by HKU done return(currentBaseWindow); } catch { return(null); } }
void currentBaseWindow_Click(object sender, EventArgs e) { currentBaseWindow = (BaseWindow)sender; formulaEditor.CurrentBaseWindow = currentBaseWindow; }
public BaseWindow initBaseWindow(string typeOfWindow, string windowName, bool isWindowSaved) { try { if (typeOfWindow == FormDesignerConstants.FormPattern) { //Check for new Window if (windowName == null) { windowName = ""; currentBaseWindow = new BaseWindow(typeOfWindow, windowName, isWindowSaved); windowName = currentBaseWindow.baseFrame.ControlName; listFormBaseWindow.Add(currentBaseWindow.baseFrame.ControlName, currentBaseWindow); listBaseWindow.Add(currentBaseWindow); DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true); } //Check if we already create this object so no need to create new one else if (!listFormBaseWindow.ContainsKey(windowName)) { //currentBaseWindow.baseFrame.DataBindings.Add("ControlName",FormDesignerUtilities.dataSetList["datapattern0"]); currentBaseWindow = new BaseWindow(typeOfWindow, windowName, isWindowSaved); listFormBaseWindow.Add(currentBaseWindow.baseFrame.ControlName, currentBaseWindow); listBaseWindow.Add(currentBaseWindow); DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true); } else { currentBaseWindow = listFormBaseWindow[windowName]; } } if (typeOfWindow == FormDesignerConstants.DataPattern) { if (windowName == null) { windowName = ""; } if (!listDataBaseWindow.ContainsKey(windowName)) { currentBaseWindow = new BaseWindow(typeOfWindow, windowName, isWindowSaved); listDataBaseWindow.Add(currentBaseWindow.baseFrame.ControlName, currentBaseWindow); listBaseWindow.Add(currentBaseWindow); DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true); } else { currentBaseWindow = listDataBaseWindow[windowName]; } } if (typeOfWindow == FormDesignerConstants.WorkflowPattern) { if (windowName == null) { windowName = ""; } if (!listWorkBaseWindow.ContainsKey(windowName)) { currentBaseWindow = new BaseWindow(typeOfWindow, windowName, isWindowSaved); listWorkBaseWindow.Add(currentBaseWindow.baseFrame.ControlName, currentBaseWindow); listBaseWindow.Add(currentBaseWindow); DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true); } else { currentBaseWindow = listWorkBaseWindow[windowName]; } } currentBaseWindow.TypeOfWindow = typeOfWindow; formulaEditor.CurrentBaseWindow = currentBaseWindow; currentBaseWindow.Click += new EventHandler(currentBaseWindow_Click); currentBaseWindow.KeyPreview = true; if (!currentBaseWindow.isKeyDown) { currentBaseWindow.KeyDown += new KeyEventHandler(eventManager.HandleCtrlDown); currentBaseWindow.KeyUp += new KeyEventHandler(eventManager.HandleCtrlUp); currentBaseWindow.KeyPress += new KeyPressEventHandler(eventManager.HandleKeyPress); currentBaseWindow.isKeyDown = true; } /*Register it only for one time*/ //DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true); //baseWindowDefaultToolClick(null, null); currentBaseWindow.MouseClick += new MouseEventHandler(eventManager.handleControlClick); if (!currentBaseWindow.baseFrame.isMouseClick) { currentBaseWindow.baseFrame.MouseClick += new MouseEventHandler(eventManager.handleControlClick); currentBaseWindow.baseFrame.isMouseClick = true; } //currentBaseWindow.SizeChanged += new EventHandler(currentBaseWindow_SizeChanged); currentBaseWindow.baseFrame.Scroll += new ScrollEventHandler(baseFrame_Scroll); currentBaseWindow.baseFrame.MouseWheel += new MouseEventHandler(baseFrame_MouseWheel); UIEventManager.form.currentBaseWindow = currentBaseWindow; FormulaEditorWindow.form.currentBaseWindow = currentBaseWindow; //Added by HKU to set the first form pattern as default screen if (currentBaseWindow.TypeOfWindow == FormDesignerConstants.FormPattern) { if (currentBaseWindow != null) { if (listFormBaseWindow.Count == 1 && FormDesignerUtilities.visibleTrueWindow.Count < 1) { currentBaseWindow.baseFrame.DefaultScreen = true; } } } //Adding by HKU done return currentBaseWindow; } catch { return null; } }