Beispiel #1
0
        private void ExportTrack()
        {
            var track = new Track();

            track.Map            = sharedContainer.GetMap();
            track.Checkpoints    = sharedContainer.GetCheckpoints();
            track.StartPosition  = sharedContainer.StartPosition;
            track.InitialHeading = sharedContainer.StartRotation;

            var trackText = JsonConvert.SerializeObject(track, Formatting.Indented);

            var baseFileName       = $"{Directory.GetCurrentDirectory()}\\Track_{DateTime.Now:YY_DD_MM_hh.mm.ss}";
            var trackFileName      = $"{baseFileName}.json";
            var trackThumbnailName = $"{baseFileName}.png";

            File.WriteAllText(trackFileName, trackText);

            ThumbnailHelper.GenerateTrackThumbnail(track, trackThumbnailName);

            notificationService.ShowToast(
                ToastType.Successful,
                "Track exported successfully");
        }