public string Load(string path = "..\\..\\Sample.gpx") { string result = null; try { XmlSerializer ser = new XmlSerializer(typeof(gpxType)); using (FileStream str = new FileStream(path, FileMode.Open)) { gpx = (gpxType)ser.Deserialize(str); } result = ""; } catch (Exception e) { result = e.Message; } return result; }
public string Load(FileStream gpxFile) { string result = null; try { XmlSerializer ser = new XmlSerializer(typeof(gpxType)); gpx = (gpxType)ser.Deserialize(gpxFile); result = ""; } catch (Exception e) { result = e.Message; } return result; }