private void UnfoldDefaultTemplate(VsTemplateLaunchPoint launchPoint) { var templatePath = this.Solution.GetTemplatePath(launchPoint); var vsTemplate = VsTemplateFile.Read(templatePath); var template = this.Templates.Find(launchPoint); this.ThrowIfNotGuidanceTemplate(template); var baseProjectName = vsTemplate.TemplateData.DefaultName; var currentSelection = this.Solution.GetSelection().FirstOrDefault(); var solutionFolder = currentSelection as ISolutionFolder; if (solutionFolder != null) { solutionFolder.Add(GenerateProjectName(solutionFolder.PhysicalPath, baseProjectName), template); } else { this.Solution.Add(GenerateProjectName(this.Solution.PhysicalPath, baseProjectName), template); } if (currentSelection != null) { currentSelection.Select(); } else { this.Solution.Select(); } }
public static string GetTemplatePath(this ISolution solution, VsTemplateLaunchPoint launchPoint) { return solution.GetTemplatePath( string.IsNullOrEmpty(launchPoint.Id) ? launchPoint.Name : launchPoint.Id, launchPoint.Category); }
public static string GetTemplatePath(this ISolution solution, VsTemplateLaunchPoint launchPoint) { return(solution.GetTemplatePath( string.IsNullOrEmpty(launchPoint.Id) ? launchPoint.Name : launchPoint.Id, launchPoint.Category)); }
public static ITemplate Find(this ITemplateService templates, VsTemplateLaunchPoint launchPoint) { return templates.Find( string.IsNullOrEmpty(launchPoint.Id) ? launchPoint.Name : launchPoint.Id, launchPoint.Category); }
public static ITemplate Find(this ITemplateService templates, VsTemplateLaunchPoint launchPoint) { return(templates.Find( string.IsNullOrEmpty(launchPoint.Id) ? launchPoint.Name : launchPoint.Id, launchPoint.Category)); }