Exemplo n.º 1
0
 private void M_prices_UpdatePrices(Tools.PriceUpdateIQ update)
 {
     //dout("PRICE UPDATE: {0}", update.LastTradePrice);
     if (label1.InvokeRequired)
     {
         label1.Invoke(new Action <PriceUpdateIQ>(M_prices_UpdatePrices), new object[] { update });
     }
     else
     {
         label1.Text = string.Format("{0}", update.LastTradePrice);
     }
 }
        private void prices_UpdatePrices(Tools.PriceUpdateIQ update)
        {
            if (!m_fxUpdates.Keys.Contains(update.Symbol))
            {
                return;
            }

            if (update.Symbol == "@DX#")
            {
                UpdateCurrencyPrice(lblDX, string.Format("DX: {0}", update.LastTradePrice));
                UpdateCurrencyPctChg(lblDXPctChg, update.PercentChange);
            }
            else if (update.Symbol == "@EU#")
            {
                UpdateCurrencyPrice(lblEUR, string.Format("EUR: {0}", update.LastTradePrice));
                UpdateCurrencyPctChg(lblEURPctChg, update.PercentChange);
            }
            else if (update.Symbol == "@BP#")
            {
                UpdateCurrencyPrice(lblGBP, string.Format("GBP: {0}", update.LastTradePrice));
                UpdateCurrencyPctChg(lblGBPPctChg, update.PercentChange);
            }
            else if (update.Symbol == "@JY#")
            {
                UpdateCurrencyPrice(lblJPY, string.Format("JPY: {0}", update.LastTradePrice));
                UpdateCurrencyPctChg(lblJPYPctChg, update.PercentChange);
            }
            else if (update.Symbol == "@CD#")
            {
                UpdateCurrencyPrice(lblCAD, string.Format("CAD: {0}", update.LastTradePrice));
                UpdateCurrencyPctChg(lblCADPctChg, update.PercentChange);
            }
            else if (update.Symbol == "@AD#")
            {
                UpdateCurrencyPrice(lblAUD, string.Format("AUD: {0}", update.LastTradePrice));
                UpdateCurrencyPctChg(lblAUDPctChg, update.PercentChange);
            }
            else if (update.Symbol == "@RB#")
            {
                UpdateCurrencyPrice(lblCNY, string.Format("CNY: {0}", update.LastTradePrice));
                UpdateCurrencyPctChg(lblCNYPctChg, update.PercentChange);
            }
            else if (update.Symbol == "@ANE#")
            {
                UpdateCurrencyPrice(lblNZD, string.Format("NZD: {0}", update.LastTradePrice));
                UpdateCurrencyPctChg(lblNZDPctChg, update.PercentChange);
            }
            else if (update.Symbol == "@SF#")
            {
                UpdateCurrencyPrice(lblCHF, string.Format("CHF: {0}", update.LastTradePrice));
                UpdateCurrencyPctChg(lblCHFPctChg, update.PercentChange);
            }
            else if (update.Symbol == "@RU#")
            {
                UpdateCurrencyPrice(lblRUB, string.Format("RUB: {0}", update.LastTradePrice));
                UpdateCurrencyPctChg(lblRUBPctChg, update.PercentChange);
            }
            else if (update.Symbol == "@KRW#")
            {
                UpdateCurrencyPrice(lblKRW, string.Format("KRW: {0}", update.LastTradePrice));
                UpdateCurrencyPctChg(lblKRWPctChg, update.PercentChange);
            }
            else
            {
                ErrorMessage("Unknown currency symbol: {0}", update.Symbol);
            }
            //dout("{0} {1}:{2}-{3}:{4}", update.Symbol, update.BidSize, update.Bid, update.Ask, update.AskSize);
        }