public static ProjectCollection FromLocalXml(BaseTeamFoundationServer server, XElement element) { ProjectCollection collection = new ProjectCollection(); collection.Server = server; collection.Id = element.Attribute("Id").Value; collection.Name = element.Attribute("Name").Value; collection.Url = new Uri(element.Attribute("Url").Value); collection.LocationServiceUrl = new Uri(element.Attribute("LocationServiceUrl").Value); collection.locationService = new LocationService(collection); collection.Projects = element.Elements("Project").Select(x => ProjectInfo.FromLocalXml(collection, x)).ToList(); return(collection); }
public static ProjectCollection FromServerXml(BaseTeamFoundationServer server, XElement element) { ProjectCollection collection = new ProjectCollection(); collection.Server = server; collection.Name = element.Attribute("DisplayName").Value; collection.Id = element.Attribute("Identifier").Value; var locationServiceElement = element.XPathSelectElement("./msg:CatalogServiceReferences/msg:CatalogServiceReference/msg:ServiceDefinition[@serviceType='LocationService']", TeamFoundationServerServiceMessage.NsResolver); string locationService = locationServiceElement.Attribute("relativePath").Value; collection.Url = UrlHelper.AddPathToUri(server.Uri, UrlHelper.GetFirstItemOfPath(locationService)); collection.LocationServiceUrl = UrlHelper.AddPathToUri(server.Uri, locationService); collection.locationService = new LocationService(collection); return(collection); }