/// <summary> /// Guarda todo en un fichero /// </summary> public void SaveInFile(string filePath) { var fileStream = File.OpenWrite(filePath); GpxWriter writer = loadTrack(_tracks, fileStream); writer.Dispose(); }
public void Dispose_ClosesOutputStreamIfWritingToStream() { MemoryStream stream = new MemoryStream(); var target = new GpxWriter(stream, new GpxWriterSettings()); target.Dispose(); Assert.False(stream.CanRead); }
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(); }
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(); }
/// <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(); }