Exemplo n.º 1
0
        private void projectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                SceanrioBuilder scb = new SceanrioBuilder();
                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.folderName = scb.projectLocation.Text;
                        EIBXMLUtilities.projectName = scb.projectNameTxtBox.Text;
                        EIBXMLUtilities.projectFilePath = EIBXMLUtilities.folderName + "/" + EIBXMLUtilities.projectName + FormDesignerConstants.ScenarioProjectFormat;
                        //////////EIBFormDesigner.UserAdmin.AccessControlList.adminDataSet.Clear();
                        NameFolderStructure();
                        applicationDoc = new XmlDocument();
                        formDesignerUtility.instantiateProjectSettings(EIBXMLUtilities.folderName, applicationDoc);
                        toolBoxToolStripMenuItem_Click(null, null);
                        datapatternExplorerToolStripMenuItem_Click(null, null);
                        propertyEditorToolStripMenuItem_Click(null, null);
                        projectExplorerToolStripMenuItem_Click(null, null);
                        // edited on 28 july by ajit
                        // users.xml not found.
                        UserAdminUtilities.UserAdminUtility.Rights.Clear();
                        //AccessControlList.createRightXml();
                        useradminutility = UserAdminUtilities.UserAdminUtility;
                        UserAdminUtilities.UserAdminUtility.Users.Clear();
                        UserAdminUtilities.UserAdminUtility.Roles.Clear();
                        UserAdminUtilities.UserAdminUtility.UserPatterns.Clear();
                        //UserAdminUtilities.Refresh();
                        this.toolBoxWindow.tabControl.SelectedIndex = 0;
                        this.Text = EIBXMLUtilities.projectName + " - Application Designer";
                        this.displayNameExplorer.formPatternMapList.Clear();
                        //propertyWindow.propertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(propertyWindow.propertyGrid.FilteredPropertyGrid_PropertyValueChanged);
                        if (scb.checkBox1.Checked)
                        {
                            LiferayWindow lfr = new LiferayWindow();
                            lfr.ShowDialog();
                        }
                    }
                }
            }
            catch (Exception err)
            {
                Console.WriteLine(err.Message);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }