protected override void OnExec() { if (template.IsVisibleFromContextMenu) { IConfigurationService configService = (IConfigurationService)ServiceProvider.GetService(typeof(IConfigurationService), true); if (template.Kind == TemplateKind.Project) { IVsSolution3 solution = (IVsSolution3)ServiceProvider.GetService(typeof(SVsSolution), true); IVsBrowseProjectLocation browseProjectLocation = null; uint cnpvdeFlags = (uint)(__VSCREATENEWPROJVIADLGEXFLAGS.VNPVDE_ALWAYSADDTOSOLUTION | __VSCREATENEWPROJVIADLGEXFLAGS.VNPVDE_ADDNESTEDTOSELECTION); //browseProjectLocation = this; //cnpvdeFlags |= (uint)(__VSCREATENEWPROJVIADLGEXFLAGS.VNPVDE_OVERRIDEBROWSEBUTTON); solution.CreateNewProjectViaDlgEx(Microsoft.Practices.RecipeFramework.VisualStudio.Properties.Resources.IDD_ADDPROJECTDLG, null, configService.CurrentPackage.Caption, this.template.Name, null, cnpvdeFlags, browseProjectLocation); } else if (template.Kind == TemplateKind.ProjectItem) { uint itemid = 0; IVsProject vsProject = DteHelper.GetCurrentSelection(this.ServiceProvider, out itemid) as IVsProject; IVsAddProjectItemDlg2 addProjectItemDlg = (IVsAddProjectItemDlg2)ServiceProvider.GetService(typeof(SVsAddProjectItemDlg), true); __VSADDITEMFLAGS addItemsFlags = __VSADDITEMFLAGS.VSADDITEM_AddNewItems | __VSADDITEMFLAGS.VSADDITEM_SuggestTemplateName; Guid projectGuid = this.template.ProjectFactory; string location = String.Empty; string filter = String.Empty; int dontShowAgain = VSConstantsEx.TRUE; addProjectItemDlg.AddProjectItemDlgTitled(itemid, ref projectGuid, vsProject, (uint)addItemsFlags, null, configService.CurrentPackage.Caption, this.template.Name, ref location, ref filter, out dontShowAgain); } } }
public int CreateNewProjectViaDlgEx(string pszDlgTitle, string pszTemplateDir, string pszExpand, string pszSelect, string pszHelpTopic, uint cnpvdeFlags, IVsBrowseProjectLocation pBrowse) { throw new Exception("The method or operation is not implemented."); }
/// <summary> /// The create new project via dlg ex. /// </summary> /// <param name="pszDlgTitle"> /// The psz dlg title. /// </param> /// <param name="pszTemplateDir"> /// The psz template dir. /// </param> /// <param name="pszExpand"> /// The psz expand. /// </param> /// <param name="pszSelect"> /// The psz select. /// </param> /// <param name="pszHelpTopic"> /// The psz help topic. /// </param> /// <param name="cnpvdeFlags"> /// The cnpvde flags. /// </param> /// <param name="pBrowse"> /// The p browse. /// </param> /// <returns> /// The create new project via dlg ex. /// </returns> /// <exception cref="Exception"> /// </exception> public int CreateNewProjectViaDlgEx(string pszDlgTitle, string pszTemplateDir, string pszExpand, string pszSelect, string pszHelpTopic, uint cnpvdeFlags, IVsBrowseProjectLocation pBrowse) { throw new Exception("The method or operation is not implemented."); }
public int CreateNewProjectViaDlgEx(string pszDlgTitle, string pszTemplateDir, string pszExpand, string pszSelect, string pszHelpTopic, uint cnpvdeFlags, IVsBrowseProjectLocation pBrowse) { return(_solution.CreateNewProjectViaDlgEx(pszDlgTitle, pszTemplateDir, pszExpand, pszSelect, pszHelpTopic, cnpvdeFlags, pBrowse)); }