Esempio n. 1
0
        private QuoteTradeControl CreateCell(QuoteTableCellSettings sets, int cellSize)
        {
            var cell = new QuoteTradeControl(sets, cellSize, selVolume =>
            {
                var dic = UserSettings.Instance.FastDealSelectedVolumeDict;
                if (!dic.ContainsKey(sets.Ticker))
                {
                    dic.Add(sets.Ticker, selVolume);
                }
                else
                {
                    dic[sets.Ticker] = selVolume;
                }
                UserSettings.Instance.FastDealSelectedVolumeDict = dic;
                UserSettings.Instance.SaveSettings();
            }, VolumeByTickerChangedDelegate)
            {
                Parent = this, AllowDrop = true
            };

            cell.DragEnter += CellDragEnter;
            cell.DragDrop  += CellDragDrop;
            cell.DragOver  += CellDragOver;
            cell.MouseDown += CellMouseDown;
            cell.DragLeave += CellDragLeave;

            cell.OnQuoteTradeClick += (command, f, symbol) => MainForm.Instance.MakeTrade(command, symbol, (int)f,
                                                                                          UserSettings.Instance.PromptTradeFromQuoteWindow);
            return(cell);
        }
Esempio n. 2
0
 public QuoteCellControl(QuoteTableCellSettings sets, int cellSize)
 {
     CellSize  = cellSize;
     Text      = sets.Ticker;
     precision = sets.Precision;
     Left      = sets.X;
     Top       = sets.Y;
     Cursor    = Cursors.Hand;
 }
Esempio n. 3
0
        private QuoteTradeDropDownList volumeQuoteDropDownList; // Выпадающий список с объёмом торгов

        public QuoteTradeControl(QuoteTableCellSettings sets, int cellSize, Action <int> selectedVolumeChanged, Action volumeByTickerChangedDelegate)
        {
            this.selectedVolumeChanged         = selectedVolumeChanged;
            this.volumeByTickerChangedDelegate = volumeByTickerChangedDelegate;

            Location = new Point(sets.X, sets.Y);
            Name     = string.Format("{0}{1}", "quoteTradeControl", sets.Ticker);

            SetSize(cellSize);
            Text      = Ticker = sets.Ticker;
            precision = sets.Precision;
        }