Exemple #1
0
        public KmlNetworkLinkControl(XmlNode parent, Logger log)
        {
            Log += log;
            foreach (XmlNode node in parent.ChildNodes)
            {
                string key = node.NamespaceURI.ToLower();
                switch (key)
                {
                case "minrefreshperiod":
                    _minRefreshPeriod = float.Parse(node.InnerText);
                    break;

                case "maxsessionlength":
                    _maxSessionLength = float.Parse(node.InnerText);
                    break;

                case "cookie":
                    _cookie = node.InnerText;
                    break;

                case "messsage":
                    _message = node.InnerText;
                    break;

                case "linkname":
                    _linkName = node.InnerText;
                    break;

                case "linkdescription":
                    _linkDescription = node.InnerText;
                    break;

                case "linksnippet":
                    _linkSnippet = node.InnerText;
                    break;

                case "expires":
                    _expires = node.InnerText;
                    break;

                case "update":
                    _update = new KmlUpdate(node, log);
                    break;

                case "lookat":
                    _view = new KmlLookAt(node, log);
                    break;

                case "camera":
                    _view = new KmlCamera(node, log);
                    break;
                }
                ;
            }
        }
Exemple #2
0
 private void initialise()
 {
     base.Id         = string.Empty;
     _name           = string.Empty;
     _visibility     = true;
     _open           = true;
     _atomAuthor     = string.Empty;
     _atomLink       = string.Empty;
     _address        = string.Empty;
     _addressDetails = string.Empty;
     _phoneNumber    = string.Empty;
     _snippet        = string.Empty;
     _description    = string.Empty;
     _abstractView   = null;
     _timePrimitive  = null;
     _styleUrl       = string.Empty;
     _styleSelector  = null;
     _region         = null;
     _extendedData   = null;
 }
Exemple #3
0
        public virtual void handleNode(XmlNode node, Logger log)
        {
            string key = node.Name.ToLower();

            debug("KmlFeature handling key " + key);
            switch (key)
            {
            case "name":
                _name = node.InnerText;
                break;

            case "visibility":
                _visibility = (node.InnerText.Equals("1")) ? true : false;
                break;

            case "open":
                _open = (node.InnerText.Equals("1")) ? true : false;
                break;

            case "atom:author":
            case "author":
                _atomAuthor = node.InnerText;
                break;

            case "atom:link":
            case "link":
                _atomLink = node.InnerText;
                break;

            case "xal:addressdetails":
            case "addressdetails":
                _addressDetails = node.InnerText;
                break;

            case "phonenumber":
                _phoneNumber = node.InnerText;
                break;

            case "snippet":
                _snippet = (node.InnerXml.Length > 0) ? node.InnerXml : node.InnerText;
                break;

            case "description":
                _description = (node.InnerXml.Length > 0) ? node.InnerXml : node.InnerText;
                break;

            case "styleurl":
                _styleUrl = node.InnerText;
                break;

            case "timespan":
                _timePrimitive = new KmlTimeSpan(node, log);
                break;

            case "timestamp":
                _timePrimitive = new KmlTimeStamp(node, log);
                break;

            case "extendeddata":
            case "metadata":
                _extendedData = new KmlExtendedData(node, log);
                break;

            case "styleselector":
                throw new Exception("StyleSelector called rather than subclass");

            case "region":
                _region = new KmlRegion(node, log);
                break;

            case "lookat":
                _abstractView = new KmlLookAt(node, log);
                break;

            case "camera":
                _abstractView = new KmlCamera(node, log);
                break;

            case "style":
                _styleSelector = new KmlStyle(node, log);
                break;

            case "stylemap":
                _styleSelector = new KmlStyleMap(node, log);
                break;

            default:
                debug("skipping tag :: " + key);
                break;
            }
            ;
        }