Ejemplo n.º 1
0
        /*****************************************************************************
        *  FUNCTION:  UpdateLiveData
        *  Description:
        *  Parameters:
        *          pLiveUrl -
        *****************************************************************************/
        public Boolean UpdateLiveData(String pLiveUrl = "")
        {
            bool success = true;

            MSHTML.HTMLDocument   htmlresponse = new MSHTML.HTMLDocument();
            MSHTML.IHTMLDocument2 webresponse  = (MSHTML.IHTMLDocument2)htmlresponse;

            try
            {
                if (pLiveUrl != "")
                {
                    LiveDataAddress = pLiveUrl;
                }

                if (LiveDataAddress != "")
                {
                    webresponse = Helpers.HTMLRequestResponse(LiveDataAddress);
                    ParseLiveData(webresponse);
                }
            }
            catch (Exception e)
            {
                success = false;
            }

            return(success);
        }
Ejemplo n.º 2
0
        /*****************************************************************************
        *  FUNCTION:       ManageDataConnections
        *  Description:
        *  Parameters:     None
        *****************************************************************************/
        private void ManageDataConnections()
        {
            String pUrl = TemplateRequestStr;

            MSHTML.HTMLDocument   htmlresponse = new MSHTML.HTMLDocument();
            MSHTML.IHTMLDocument2 webresponse  = (MSHTML.IHTMLDocument2)htmlresponse;

            if (LockedForUpdate == false)
            {
                LockedForUpdate = true;

                //Disable timer ticks
                LiveSessionTimer.Stop();
                SendMessage(this.ParentFormPtr, WM_UPDATING_DATA, IntPtr.Zero, IntPtr.Zero);

                /**** Download Data ****/
                pUrl += "?noconstruct=1" + "&smlID=" + ActiveMarket.smlId +
                        "&sid=" + ActiveMarket.sid + "&tabletype=price" + "&index_id=" + ActiveMarket.id;

                webresponse = Helpers.HTMLRequestResponse(pUrl);

                //Parse the downloaded HTML file
                if (HistoricalData == null)
                {
                    HistoricalData = new ExchangeMarket();
                }

                HistoricalData.parseHtmlLiveData(webresponse, pUrl, ActiveMarket.name);

                SendMessage(this.ParentFormPtr, WM_LIVEUPDATE, IntPtr.Zero, IntPtr.Zero);

                LockedForUpdate = false;
                LiveSessionTimer.Start();
            }
        }