Example #1
0
        /// <summary>
        /// Guarda todo en un fichero
        /// </summary>
        public void SaveInFile(string filePath)
        {
            var       fileStream = File.OpenWrite(filePath);
            GpxWriter writer     = loadTrack(_tracks, fileStream);

            writer.Dispose();
        }
Example #2
0
        public void Dispose_ClosesOutputStreamIfWritingToStream()
        {
            MemoryStream stream = new MemoryStream();

            var target = new GpxWriter(stream, new GpxWriterSettings());

            target.Dispose();

            Assert.False(stream.CanRead);
        }
Example #3
0
        public void Dispose_ClosesOutputStreamIfWritingToFiles()
        {
            string path = PathHelper.GetTempFilePath("gpxwriter-closes-output-filestream-test.osm");

            var target = new GpxWriter(path, new GpxWriterSettings());

            target.Dispose();

            FileStream testStream = null;

            testStream = new FileStream(path, FileMode.Open, FileAccess.ReadWrite);
            testStream.Dispose();
        }
Example #4
0
        public void Dispose_ClosesOutputStreamIfWritingToFiles()
        {
            string path = "TestFiles\\gpxwriter-closes-output-filestream-test.osm";

            File.Delete(path);

            var target = new GpxWriter(path, new GpxWriterSettings());

            target.Dispose();

            FileStream testStream = null;

            Assert.DoesNotThrow(() => testStream = new FileStream(path, FileMode.Open, FileAccess.ReadWrite));
            testStream.Dispose();
        }
Example #5
0
        /// <summary>
        /// Guarda todo en un fichero
        /// </summary>
        public void SaveInStream(Stream stream,
                                 string link_Href   = "https://rutoteca.es/",
                                 string link_Text   = "Rutoteca",
                                 string mimeType    = "text/html",
                                 string name        = "Rutoteca",
                                 string descripcion = "Visita Rutoteca el mayor almacen de rutas homologadas de EspaƱa")
        {
            GpxWriter writer = loadTrack(_tracks,
                                         stream,
                                         link_Href,
                                         link_Text,
                                         mimeType,
                                         name,
                                         descripcion);

            writer.Dispose();
        }