Exemplo n.º 1
0
        public void NewProject()
        {
            NewProjectForm npf = new NewProjectForm();

            Form1StringResources.SetTextForAllControls(npf);

            if (npf.ShowDialog() == DialogResult.OK)
            {
                if (ProjectFactory.Instance.ProjectLoaded)
                {
                    if (!CloseProject())
                    {
                        return;
                    }
                }
                PascalABCCompiler.IProjectInfo proj = ProjectFactory.Instance.CreateProject(npf.ProjectName, npf.ProjectFileName, npf.ProjectType);
                ProjectExplorerWindow.LoadProject(npf.ProjectName, ProjectFactory.Instance.CurrentProject);
                ProjectExplorerWindow.Show();
                //ShowContent(ProjectExplorerWindow,true);
                CloseFilesAndSaveState();
                ClearAndSaveWatch();
                SelectContent(ProjectExplorerWindow, false);
                WorkbenchServiceFactory.FileService.OpenFile(proj.MainFile, null);
                ActiveCodeFileDocument = CurrentCodeFileDocument;
                AddLastProject(npf.ProjectFileName);
                if (CodeCompletion.CodeCompletionController.comp != null)
                {
                    CodeCompletion.CodeCompletionController.comp.CompilerOptions.CurrentProject = proj;
                }
                this.mRPROJECTToolStripMenuItem.Visible = true;
                this.miCloseProject.Visible             = true;
                if (proj.ProjectType == PascalABCCompiler.ProjectType.WindowsApp)
                {
                    //string s = ProjectFactory.Instance.GetFullUnitFileName();
                    //OpenFile(null,s);
                    //CurrentCodeFileDocument.AddDesigner(null);
                    ProjectTask.NewForm(ProjectExplorerWindow, false);//roman//
                    GenerateMainProgramForDesigner(proj.MainFile);
                    //OpenFile(s,null);
                    //SaveFileAs(CurrentCodeFileDocument,s);
                    //CurrentCodeFileDocument.DesignerAndCodeTabs.SelectedTab = CurrentCodeFileDocument.DesignerPage;
                    //ProjectTask.AddFile(ProjectExplorerWindow,Path.GetFileName(s));
                    SaveAll(false);
                }
            }
        }
Exemplo n.º 2
0
        public void NewProject()
        {
            NewProjectForm npf = new NewProjectForm();
            Form1StringResources.SetTextForAllControls(npf);

            if (npf.ShowDialog() == DialogResult.OK)
            {
                if (ProjectFactory.Instance.ProjectLoaded)
                {
                    if (!CloseProject())
                        return;
                }
                PascalABCCompiler.IProjectInfo proj = ProjectFactory.Instance.CreateProject(npf.ProjectName, npf.ProjectFileName, npf.ProjectType);
                ProjectExplorerWindow.LoadProject(npf.ProjectName, ProjectFactory.Instance.CurrentProject);
                ProjectExplorerWindow.Show();
                //ShowContent(ProjectExplorerWindow,true);
                CloseFilesAndSaveState();
                ClearAndSaveWatch();
                SelectContent(ProjectExplorerWindow, false);
                WorkbenchServiceFactory.FileService.OpenFile(proj.MainFile, null);
                ActiveCodeFileDocument = CurrentCodeFileDocument;
                AddLastProject(npf.ProjectFileName);
                if (CodeCompletion.CodeCompletionController.comp != null)
                {
                    CodeCompletion.CodeCompletionController.comp.CompilerOptions.CurrentProject = proj;
                }
                this.mRPROJECTToolStripMenuItem.Visible = true;
                this.miCloseProject.Visible = true;
                if (proj.ProjectType == PascalABCCompiler.ProjectType.WindowsApp)
                {
                    //string s = ProjectFactory.Instance.GetFullUnitFileName();
                    //OpenFile(null,s);
                    //CurrentCodeFileDocument.AddDesigner(null);
                    ProjectTask.NewForm(ProjectExplorerWindow, false);//roman//
                    GenerateMainProgramForDesigner(proj.MainFile);
                    //OpenFile(s,null);
                    //SaveFileAs(CurrentCodeFileDocument,s);
                    //CurrentCodeFileDocument.DesignerAndCodeTabs.SelectedTab = CurrentCodeFileDocument.DesignerPage;
                    //ProjectTask.AddFile(ProjectExplorerWindow,Path.GetFileName(s));
                    SaveAll(false);
                }
            }
        }