コード例 #1
0
ファイル: MainForm.cs プロジェクト: johnmensen/TradeSharp
        private void GridQuoteUserHitCell(object sender, MouseEventArgs e, int rowIndex, FastColumn col)
        {
            if (e.Button == MouseButtons.Right)
            {
                var selected = gridQuote.rows.Where(r => r.Selected).Select(r => (TickerInfo) r.ValueObject).ToList();
                menuQuote.Tag = selected.Count > 1
                                    ? selected
                                    : new List<TickerInfo> {(TickerInfo) gridQuote.rows[rowIndex].ValueObject};
                menuQuote.Show(gridQuote, e.X, e.Y);
                return;
            }

            selectedTicker = (TickerInfo)gridQuote.rows[rowIndex].ValueObject;
            tbActiveBase.Text = selectedTicker.ActiveBase;
            tbActiveCounter.Text = selectedTicker.ActiveCounter;
            tbFormat.Text = string.Format("{0:f" + selectedTicker.Precision + "}", 1.2345678);
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: zhangjiayin/TradeSharp
        private void GridQuoteUserHitCell(object sender, MouseEventArgs e, int rowIndex, FastColumn col)
        {
            if (e.Button == MouseButtons.Right)
            {
                var selected = gridQuote.rows.Where(r => r.Selected).Select(r => (TickerInfo)r.ValueObject).ToList();
                menuQuote.Tag = selected.Count > 1
                                    ? selected
                                    : new List <TickerInfo> {
                    (TickerInfo)gridQuote.rows[rowIndex].ValueObject
                };
                menuQuote.Show(gridQuote, e.X, e.Y);
                return;
            }

            selectedTicker       = (TickerInfo)gridQuote.rows[rowIndex].ValueObject;
            tbActiveBase.Text    = selectedTicker.ActiveBase;
            tbActiveCounter.Text = selectedTicker.ActiveCounter;
            tbFormat.Text        = string.Format("{0:f" + selectedTicker.Precision + "}", 1.2345678);
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: zhangjiayin/TradeSharp
        private void RefreshTickers()
        {
            var tickers = TickerInfo.GetTickers();

            gridQuote.DataBind(tickers);
        }