public override void Run()
 {
     AbstractProjectBrowserTreeNode node = ProjectBrowserPad.Instance.ProjectBrowserControl.SelectedNode;
     ISolutionFolderNode solutionFolderNode = node as ISolutionFolderNode;
     if (node != null) {
         using (NewProjectDialog npdlg = new NewProjectDialog(false)) {
             npdlg.InitialProjectLocationDirectory = GetInitialDirectorySuggestion(solutionFolderNode);
             
             // show the dialog to request project type and name
             if (npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
                 if (npdlg.NewProjectLocation.Length == 0) {
                     MessageService.ShowError("No project has been created, there is nothing to add.");
                     return;
                 }
                 AddExitingProjectToSolution.AddProject(solutionFolderNode, npdlg.NewProjectLocation);
                 ProjectService.SaveSolution();
                 
                 if(SDLite.UpdateInfo.ExpandNewProjectByDefaut)
                 {
                     IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
                     
                     if(window != null && window.ActiveViewContent != null)
                         ProjectBrowserPad.Instance.ProjectBrowserControl.SelectFile(window.ActiveViewContent.PrimaryFileName);
                     
                     node = ProjectBrowserPad.Instance.ProjectBrowserControl.SelectedNode;
                     
                     if(node is ProjectNode)
                         node.Expand();
                 }
             }
         }
     }
 }
		public override void Run()
		{
			
			
			using (NewProjectDialog npdlg = new NewProjectDialog(true)) {
				npdlg.Owner = WorkbenchSingleton.MainForm;
				npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
			}
		}
		public override void Run()
		{
			AbstractProjectBrowserTreeNode node = ProjectBrowserPad.Instance.ProjectBrowserControl.SelectedNode;
			ISolutionFolderNode solutionFolderNode = node as ISolutionFolderNode;
			if (node != null) {
				using (NewProjectDialog npdlg = new NewProjectDialog(false)) {
					if (npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
						if (npdlg.NewProjectLocation.Length == 0) {
							MessageService.ShowError("No project has been created, there is nothing to add.");
							return;
						}
						AddExitingProjectToSolution.AddProject(solutionFolderNode, npdlg.NewProjectLocation);
						ProjectService.SaveSolution();
					}
				}
			}
		}
Exemple #4
0
        public ProjectTemplateResult ShowNewProjectDialog(ISolutionFolder solutionFolder, IEnumerable<TemplateCategory> templates)
        {
            #if DEBUG
            SD.Templates.UpdateTemplates();
            #endif
            using (NewProjectDialog npdlg = new NewProjectDialog(templates ?? SD.Templates.TemplateCategories, createNewSolution: solutionFolder == null)) {
                npdlg.SolutionFolder = solutionFolder;
                if (solutionFolder != null) {
                    npdlg.InitialProjectLocationDirectory = AddNewProjectToSolution.GetInitialDirectorySuggestion(solutionFolder);
                }

                // show the dialog to request project type and name
                if (npdlg.ShowDialog(SD.WinForms.MainWin32Window) == DialogResult.OK) {
                    return npdlg.result;
                } else {
                    return null;
                }
            }
        }
		public override void Run()
		{
			TreeNode node = ProjectBrowserPad.Instance.ProjectBrowserControl.SelectedNode;
			while (node != null && !(node is ISolutionFolderNode))
				node = node.Parent;
			ISolutionFolderNode solutionFolderNode = node as ISolutionFolderNode;
			if (node != null) {
				using (NewProjectDialog npdlg = new NewProjectDialog(false)) {
					npdlg.InitialProjectLocationDirectory = GetInitialDirectorySuggestion(solutionFolderNode);
					
					// show the dialog to request project type and name
					if (npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
						if (npdlg.NewProjectLocation.Length == 0) {
							MessageService.ShowError("No project has been created, there is nothing to add.");
							return;
						}
						AddExitingProjectToSolution.AddProject(solutionFolderNode, npdlg.NewProjectLocation);
						ProjectService.SaveSolution();
					}
				}
			}
		}