public static GpxTrack FromXElement(XElement xe) { GpxTrack track = new GpxTrack(); track.Name = xe.Element(Gpx.ns + "name").Value; track.Description = xe.Element(Gpx.ns + "desc").Value; track.Segs = xe.Elements(Gpx.ns + "trkseg").Select(x => GpxTrackSeg.FromXElement(x)).ToList(); return(track); }
public static Gpx Load(string fileName) { Gpx result = new Gpx(); result.Tracks = XDocument.Load(fileName).Root.Elements(ns + "trk").Select(x => GpxTrack.FromXElement(x)).ToList(); return(result); }