コード例 #1
0
ファイル: KwxClient.cs プロジェクト: codehaus/geotracing
        /// <summary>
        /// get route list.
        /// </summary>
        public XMLement getRouteList()
        {
            if (mAgentKey != null)
            {
                XMLement req1 = new XMLement(Protocol.TAG_GET_ROUTELIST_REQ);
                XMLement req2 = new XMLement(Protocol.TAG_GET_ROUTELIST_REQ);
                req1.addAttribute("type", "fixed");
                req2.addAttribute("type", "generated");

                req1 = utopiaRequest(req1);
                req2 = utopiaRequest(req2);

                if (req1 != null && req2 != null && (req1.tag == Protocol.TAG_GET_ROUTELIST_RSP) && (req1.tag == Protocol.TAG_GET_ROUTELIST_RSP))
                {
                    for (int i = 0; ; i++)
                    {
                        XMLement x = req1.getChild(i);
                        if (x != null)
                        {
                            req2.addChild(x);
                        }
                        else
                        {
                            break;
                        }
                    }
                    return(req2);
                }
                else
                {
                    return(null);
                }
            }
            return(new XMLement("NotLoggedInError"));
        }
コード例 #2
0
ファイル: PoiViewerPage.cs プロジェクト: codehaus/geotracing
        void dnlDoneT(string path, bool local)
        {
            mMediaDnl = null;

            if (local)
            {
                AppController.sEventLog.WriteLine("\tHit local store: {0}", path);
            }
            else
            {
                AppController.sEventLog.WriteLine("\tDownloaded url: {0}", mDnlUrl);
            }

            dnlFileNames[mDownloadIndex] = path;

            if (this.mIsActive && (mDownloadIndex == mMediaIndex))
            {
                if (InvokeRequired)
                {
                    this.Invoke(new mediaCallback(this.openFile), new object[] { path });
                }
                else
                {
                    openFile(path);
                }
            }

            if (mAllMedia.getChild(1 + mDownloadIndex) != null)
            {
                mDownloadIndex = mDownloadIndex + 1;
                doDownloadMedium(mDownloadIndex);
            }
            else
            {
                if (mIsActive)
                {
                    drawDnlText("");
                }
                else
                {
                    AppController.sPoiSelectPage.setDownloadMessage("downloads: done");
                }
            }
        }
コード例 #3
0
ファイル: PoiViewerPage.cs プロジェクト: codehaus/geotracing
        public bool setContent(XMLement xml)
        {
            setMenuText(0, "Volgende");
            setMenuIcon(0, AppController.sVolgIcon);
            abortDownload();
            XMLement name = xml.getChildByName("name");

            if (name != null)
            {
                title = name.nodeText;
            }
            mAllMedia = xml.getChildByName("media");
            AppController.sEventLog.WriteLine(mAllMedia.toString());
            mDnlName = "";
            drawNameText();

            mMediaIndex    = -1;
            mDownloadIndex = -1;
            mImage.x       = 500;

            for (int i = 0; i < 10; i++)
            {
                dnlFileNames[i] = null;
            }
            if (mAllMedia.getChild(0) != null)
            {
                doDownloadMedium(0);
            }
            else
            {
                setMenuText(0, "Terug");
                setMenuIcon(0, AppController.sTerugIcon);
                return(false);
            }
            return(true);
        }
コード例 #4
0
        void navPointReceive(XMLement xml, float lat, float lon)
        {
            if (mIsActive)
            {
                XMLement poi = xml.getChildByName("poi-hit");
                XMLement ugc = xml.getChildByName("ugc-hit");

                if (poi != null)
                {
                    List <string> pois = new List <string>();
                    for (int i = 0; ; i++)
                    {
                        XMLement t = xml.getChild(i);
                        if (t == null)
                        {
                            break;
                        }
                        if (t.tag == "poi-hit")
                        {
                            string poiId = t.getAttributeValue("id");
                            if (!mHitPOI.Contains(poiId))
                            {
                                mHitPOI.Add(poiId);
                                pois.Add(poiId);
                            }
                        }
                    }
                    if (pois.Count > 0)
                    {
                        doPoi(pois);
                    }
                }

                if (ugc != null)
                {
                    List <XMLement> ugcs = new List <XMLement>();
                    for (int i = 0; ; i++)
                    {
                        XMLement t = xml.getChild(i);
                        if (t == null)
                        {
                            break;
                        }
                        if (t.tag == "ugc-hit")
                        {
                            string ugcId = t.getAttributeValue("id");
                            if (!mHitUGC.Contains(ugcId))
                            {
                                mHitUGC.Add(ugcId);
                                ugcs.Add(t);
                            }
                        }
                    }
                    if (ugcs.Count > 0)
                    {
                        doUgcs(ugcs);
                    }
                }


                XMLement msg = xml.getChildByName("msg");
                if (msg != null)
                {
                    string text = msg.nodeText;
                    if (text == "roam" && checkStruinWithUser == true)
                    {
                        checkStruinWithUser = false;
                        doCheckStruin(0, "");
                    }
                }
            }
        }