Exemple #1
0
        private void QuoteUpdate(string exchangeName, string dataSource, IQuote quote)
        {
            string sSymbolId = quote.SymbolId;
            int    iIndex    = source.IndexOf(sSymbolId);

            _QuoteInfo cQuoteInfo = null;
            double     dPrice     = quote.RealTick.Price;

            if (iIndex == -1)
            {
                if (sSymbolId.Length == 0)
                {
                    return;
                }
                else
                {
                    cQuoteInfo = new _QuoteInfo(exchangeName, dataSource, sSymbolId, quote.SymbolName, dPrice);
                    source.Add(cQuoteInfo);
                }
            }
            else
            {
                cQuoteInfo = source.GetItemAt(iIndex);
            }

            cQuoteInfo.SetPrice(dPrice);
            cQuoteInfo.SetVolume(quote.RealTick.Volume);
            cQuoteInfo.SetTime(quote.RealTick.Time.TimeOfDay);
        }
Exemple #2
0
 private void dataGrid_DoubleClick(object sender, EventArgs e)
 {
     if (dataGrid.SelectedDataRows.Length > 0)
     {
         _QuoteInfo cQuoteInfo = dataGrid.SelectedDataRows[0] as _QuoteInfo;
         if (cQuoteInfo != null)
         {
             frmTrustViewer frmTrustViewer = new frmTrustViewer(cQuoteInfo.DataSource, cQuoteInfo.SymbolId, cQuoteInfo.DecimalPoint);
             frmTrustViewer.Show();
         }
     }
 }