/// <summary> /// Deletes the project mapping entry. /// </summary> /// <param name="projectMappingTableName">Name of the project mapping table.</param> /// <param name="projectId">The project id.</param> public void DeleteProjectMappingEntry(string projectMappingTableName, Guid projectId) { Guard.ArgumentNotNullOrEmptyString(projectMappingTableName, "projectMappingTableName"); GuidGuard.GuidNotEmpty(projectId, "projectId"); ProjectMappingTable projectMappingTable = this.ProjectMappingInformation.FindProjectMappingTableByName(projectMappingTableName); if (projectMappingTable == null) { throw new ProjectMappingTableNotFoundException(Properties.Resources.ProjectMappingTableNotFound); } ProjectMapping.Configuration.ProjectMappingEntry projectMapping = projectMappingTable.FindProjectMappingByProjectId(projectId); if (projectMapping == null) { throw new ProjectMappingNotFoundException(Properties.Resources.ProjectNotFound); } //Delete ProjectMapping projectMappingTable.ProjectMappings.Remove(projectMapping); UpdateMappingFile(); }
public ProjectMappingEntry FindProjectMappingByProjectId(Guid projectId) { GuidGuard.GuidNotEmpty(projectId, "projectId"); return(FindProjectMapping(delegate(ProjectMappingEntry projectMapping) { Guid mappingProjectId = new Guid(projectMapping.ProjectId); return mappingProjectId.Equals(projectId); })); }
/// <summary> /// Gets the project mapping entry. /// </summary> /// <param name="projectMappingTableName">Name of the project mapping table.</param> /// <param name="projectId">The project id.</param> /// <returns></returns> public ProjectMapping.Configuration.ProjectMappingEntry GetProjectMappingEntry( string projectMappingTableName, Guid projectId) { Guard.ArgumentNotNullOrEmptyString(projectMappingTableName, "projectMappingTableName"); GuidGuard.GuidNotEmpty(projectId, "projectId"); ProjectMappingTable projectMappingTable = this.ProjectMappingInformation.FindProjectMappingTableByName(projectMappingTableName); if (projectMappingTable == null) { throw new ProjectMappingTableNotFoundException(Properties.Resources.ProjectMappingTableNotFound); } return(projectMappingTable.FindProjectMappingByProjectId(projectId)); }
/// <summary> /// Gets the project. /// </summary> /// <param name="projectId">The project id.</param> /// <returns></returns> public EnvDTE.Project GetProject(Guid projectId) { GuidGuard.GuidNotEmpty(projectId, "projectId"); return(new HierarchyNode(vsSolution, projectId).ExtObject as EnvDTE.Project); }