public void Serialize(IEnumerable<Place> places, Stream destination) { var gpx = new gpxType() { creator = "SensorCore Export", wpt = GetWaypoints(places).ToArray() }; var ns = new XmlSerializerNamespaces(); ns.Add("sce", _sce.NamespaceName); var ser = new XmlSerializer(typeof(gpxType)); ser.Serialize(destination, gpx, ns); }
public void Serialize(IEnumerable<TrackPoint> trackpoints, Stream destination) { var waypointsPerDay = trackpoints.GroupBy(w => w.Timestamp.Date); var gpx = new gpxType { creator = "SensorCore Export", trk = GetTracks(waypointsPerDay).ToArray() }; var ns = new XmlSerializerNamespaces(); ns.Add("sce", _sce.NamespaceName); var ser = new XmlSerializer(typeof(gpxType)); ser.Serialize(destination, gpx, ns); }