Ejemplo n.º 1
0
        void doTerugStart(int i, string s)
        {
            XMLement xml = AppController.sKwxClient.routeHome();

            xml = xml.getChildByName("route");
            // string xs = xml.toString();
            // AppController.sEventLog.WriteLine(xml.toString());
            if (xml != null && xml.getAttributeValue("id") != null)
            {
                if (AppController.sActiveRouteID != -1)
                {
                    AppController.sKwxClient.deActivateRoute();
                    AppController.sActiveRouteID = -1;
                    AppController.sActiveRoute   = null;
                }
                AppController.sActiveRouteID = int.Parse(xml.getAttributeValue("id"));
                AppController.sKwxClient.activateRoute(AppController.sActiveRouteID, false);
                AppController.sActiveRoute           = xml;
                AppController.sActiveRouteMapPathHor = null;
                AppController.sActiveRouteMapPathVer = null;
                AppController.sKwxClient.activateRoute(AppController.sActiveRouteID, true);
                walkRoute(0, "");
            }
            else
            {
                resetMenu();
            }
        }
Ejemplo n.º 2
0
        bool offerPOI(string poiID)
        {
            XMLement x = AppController.sKwxClient.getPOI(poiID);

            if (x != null)
            {
                AppController.sEventLog.WriteLine("\tpoi: {0}", poiID);
                x = x.getChildByName("poi");

                if (x != null)
                {
                    mCurrentPOI = x;
                    XMLement name_xml = x.getChildByName("name");
                    if (name_xml != null)
                    {
                        AppController.sEventLog.WriteLine("\tname: {0}", name_xml.nodeText);
                        title = name_xml.nodeText;
                    }
                    XMLement desc_xml = x.getChildByName("description");
                    if (desc_xml != null)
                    {
                        AppController.sEventLog.WriteLine("\tdesc: {0}", desc_xml.nodeText);
                        mTextBox.Text = desc_xml.nodeText;
                    }
                    mTextBox.Visible = true;
                    mHasContent      = sPoiPage.setContent(x);
                    if (mHasContent)
                    {
                        setMenuText(0, "Toon Media");
                    }
                    else
                    {
                        setMenuText(0, "Geen Media");
                    }
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 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, "");
                    }
                }
            }
        }