public void WriteKmlProperties(KmlProperties prop)
        {
            try
            {
                if (prop.Author != null && prop.Author != "")
                    WriteElementString("atom:author", prop.Author);
                if (prop.Link != null && prop.Link != "")
                    WriteElementString("atom:link", prop.Link);
                if (prop.Address != null && prop.Address != "")
                    WriteElementString("address", prop.Address);
                if (prop.Snippit != null && prop.Snippit != "")
                {
                    WriteStartElement("Snippit");

                    if (prop.SnippitMaxLines != null)
                        WriteAttributeString("maxLines", prop.SnippitMaxLines.ToString());
                    else
                        WriteAttributeString("maxLines", "2");

                    WriteValue(prop.Snippit);
                    WriteEndElement();
                }

                if (prop.Region != null && prop.Region != "")
                    WriteElementString("region", prop.Region);

                //write extended data
                if (prop.ExtendedData != null)
                {
                    if (prop.ExtendedData.DataItems.Count > 0)
                    {
                        WriteStartElement("ExtendedData");

                        foreach (KmlExtendedData.Data data in prop.ExtendedData.DataItems)
                        {
                            if (data.Name != null && data.Value != null)
                            {
                                WriteStartElement("Data");
                                WriteAttributeString("name", data.Name);
                                WriteElementString("value", data.Value);
                                WriteEndElement();
                            }
                        }

                        WriteEndElement();
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("WriteKmlProperties Error: " + ex.Message);
            }
        }
        public KmlPlacemark(KmlPlacemark pm)
        {
            Init(pm.Name, pm.Desctription, new KmlView(pm.View));

            _CN = pm._CN;
            StyleUrl = pm.StyleUrl; ;
            Properties = new KmlProperties(pm.Properties);
            Visibility = pm.Visibility;
            Open = pm.Open;

            _Polygons = pm.Polygons.ToList();
            _Points = pm.Points.ToList();
        }
 public KmlProperties(KmlProperties p)
 {
     Author = p.Author;
     Link = p.Link;
     Address = p.Address;
     Snippit = p.Snippit;
     SnippitMaxLines = p.SnippitMaxLines;
     Region = p.Region;
     ExtendedData = p.ExtendedData;
 }