Esempio n. 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();
        }
Esempio n. 2
0
        public void Dispose_ClosesOutputStreamIfWritingToStream()
        {
            MemoryStream stream = new MemoryStream();

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

            target.Dispose();

            Assert.False(stream.CanRead);
        }
Esempio n. 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();
        }
Esempio n. 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();
        }
Esempio n. 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();
        }