private void btnLoad_Click(object sender, EventArgs e) { // einlesen der Datei KmlIO kmlIO = new KmlIO(showTxt); myKml = kmlIO.read(tBKmlDateiName.Text); //KmlIO.write(@"..\..\..\Daten\Ideen_neu.kml",myKml); // Anzeigen der Datei //tbOut.Clear(); Show(myKml); }
private void Show(kml myKml) { kmlDocument Document = myKml.Document; foreach (var item in Document.Items) { if (item.GetType() == typeof(kmlFolder)) { showFolder((kmlFolder)item,0); } } }
public void write(String FileName, kml kmlData) { System.Xml.Serialization.XmlSerializer writer = new System.Xml.Serialization.XmlSerializer(typeof(kml)); FileStream fs = new FileStream(FileName, FileMode.OpenOrCreate); writer.Serialize(fs,kmlData); fs.Close(); }
public kml read(String sourceFileName) { System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer(typeof(kml)); deserialisationEvents.OnUnknownAttribute = unknownAttribute; deserialisationEvents.OnUnknownElement = unknownElement; deserialisationEvents.OnUnknownNode = unknownNode; deserialisationEvents.OnUnreferencedObject = unreferencedObject; kml myKml = new kml(); FileStream fs = new FileStream(sourceFileName, FileMode.Open); XmlReader xmlReader = XmlReader.Create(fs); myKml = (kml)reader.Deserialize(xmlReader, deserialisationEvents); fs.Close(); return myKml; }