コード例 #1
0
        // bug #70 (foute versie, komt door de gpxx extensions tag)
        public void Load_Incorrect_GPX_no_tracks()
        {
            var path    = Path.Combine(UnitTestDirectory, "70.gpx");
            var gpxFile = new GPXFile(path);

            gpxFile.GetTracks().Count.Should().Be(0);
        }
コード例 #2
0
        // bug #70 (foute versie, maar de gpxx extensions tag verwijderd voor de track)
        public void Load_Incorrect_GPX_but_manually_fixed_one_track()
        {
            var path    = Path.Combine(UnitTestDirectory, "70_2.gpx");
            var gpxFile = new GPXFile(path);

            gpxFile.GetTracks().Count.Should().Be(1);
        }
コード例 #3
0
        private void LoadTracks(GPXFile gpx)
        {
            var trackIndex = 1;

            foreach (var track in gpx.GetTracks())
            {
                var gpxTrack = new Track();
                if (string.IsNullOrEmpty(track.name) && string.IsNullOrEmpty(gpx.Name))
                {
                    track.name = $"t{trackIndex.ToString()}";
                    trackIndex++;
                }
                gpxTrack.Name     = string.IsNullOrEmpty(track.name) ? gpx.Name : track.name;
                gpxTrack.Segments = track.trkseg;
                _gpxData.Tracks.Add(gpxTrack);
            }
        }