Пример #1
0
 internal KMLStyle()
     : base()
 {
     m_oLineStyle = new KMLLineStyle();
     m_oListStyle = new KMLListStyle();
     m_oIconStyle = new KMLIconStyle();
     m_oLabelStyle = new KMLLabelStyle();
     m_oPolyStyle = new KMLPolyStyle();
     m_oBalloonStyle = new KMLBalloonStyle();
 }
Пример #2
0
        internal KMLStyle(XmlElement element, KMLFile source)
            : base(element, source)
        {
            foreach (XmlNode oChildNode in element.ChildNodes)
            {
                if (oChildNode.NodeType != XmlNodeType.Element) continue;
                XmlElement oChildElement = oChildNode as XmlElement;

                if (oChildElement.Name.Equals("IconStyle"))
                {
                    m_oIconStyle = new KMLIconStyle(oChildElement, source);
                }
                else if (oChildElement.Name.Equals("LabelStyle"))
                {
                    m_oLabelStyle = new KMLLabelStyle(oChildElement, source);
                }
                else if (oChildElement.Name.Equals("LineStyle"))
                {
                    m_oLineStyle = new KMLLineStyle(oChildElement, source);
                }
                else if (oChildElement.Name.Equals("PolyStyle"))
                {
                    m_oPolyStyle = new KMLPolyStyle(oChildElement, source);
                }
                else if (oChildElement.Name.Equals("BalloonStyle"))
                {
                    m_oBalloonStyle = new KMLBalloonStyle(oChildElement, source);
                }
                else if (oChildElement.Name.Equals("ListStyle"))
                {
                    m_oListStyle = new KMLListStyle(oChildElement, source);
                }
            }

            if (m_oIconStyle == null) m_oIconStyle = new KMLIconStyle();
            if (m_oLabelStyle == null) m_oLabelStyle = new KMLLabelStyle();
            if (m_oLineStyle == null) m_oLineStyle = new KMLLineStyle();
            if (m_oPolyStyle == null) m_oPolyStyle = new KMLPolyStyle();
            if (m_oBalloonStyle == null) m_oBalloonStyle = new KMLBalloonStyle();
            if (m_oListStyle == null) m_oListStyle = new KMLListStyle();
        }