Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        private void Show(kml myKml)
        {
            kmlDocument Document = myKml.Document;

            foreach (var item in Document.Items)
            {
                if (item.GetType() == typeof(kmlFolder))
                {
                    showFolder((kmlFolder)item,0);
                }
            }
        }
Exemplo n.º 3
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();
 }
Exemplo n.º 4
0
        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;
        }