WebProject IVisualStudioService.GetWebProject() { this._dte = (DTE)_serviceProvider.GetService(typeof(DTE)); foreach (Project project in _dte.Solution.Projects) { var projectTypeGuid = GetProjectTypeGuids(project); var webProject = new WebProject { Project = project }; webProject.ProjectType = GetProjectType(projectTypeGuid); if (webProject.ProjectType != ProjectType.Other) { return webProject; } } return null; }
private IPagesService GetPageService(WebProject webProject) { IPagesService pageService = null; switch (webProject.ProjectType) { case ProjectType.MVC2: pageService = new MVC2PagesService(_regexService); break; case ProjectType.MVC3: pageService = new MVC3PagesService(_regexService); break; case ProjectType.WebForm: pageService = new WebFormPagesService(_regexService); break; } return pageService; }