private void OnNewMarketDepth(object sender, MarketDepthEventArgs args) { if (!this.isRunning || !this.cbxMarketDepth.Checked) { return; } this.queue.Enqueue((Action)(() => { Instrument local_0 = ((IntradayEventArgs)args).Instrument as Instrument; InstrumentRow local_1 = this.instruments[local_0] as InstrumentRow; if (local_1 == null) { return; } local_0.Add(args.MarketDepth); ++local_1.MarketDepths; })); }
private void RemoveInstrument(Instrument instrument) { InstrumentRow instrumentRow = this.instruments[instrument] as InstrumentRow; if (instrumentRow != null) { this.dgvPanel.Rows.Remove((DataGridViewRow)instrumentRow); } this.instruments.Remove(instrument); if (!this.isRunning) { return; } this.CancelMarketData(new Instrument[1] { instrument }, this.GetMarketDataType()); }
private void OnNewQuote(object sender, QuoteEventArgs args) { if (!this.isRunning || !this.cbxQuotes.Checked) { return; } this.queue.Enqueue((Action)(() => { Instrument local_0 = ((IntradayEventArgs)args).Instrument as Instrument; InstrumentRow local_1 = this.instruments[local_0] as InstrumentRow; if (local_1 == null) { return; } local_0.Add(args.Quote); ++local_1.Quotes; })); }
private void AddInstrument(Instrument instrument) { if (this.instruments.ContainsKey(instrument)) { return; } InstrumentRow instrumentRow = new InstrumentRow(instrument); instrumentRow.Height = this.dgvPanel.RowTemplate.Height; instrumentRow.ContextMenuStrip = this.dgvPanel.RowTemplate.ContextMenuStrip; this.dgvPanel.Rows.Add((DataGridViewRow)instrumentRow); this.instruments.Add(instrument, instrumentRow); if (!this.isRunning) { return; } this.RequestMarketData(new Instrument[1] { instrument }, this.GetMarketDataType()); }
private void AddInstrument(Instrument instrument) { if (this.instruments.ContainsKey(instrument)) return; InstrumentRow instrumentRow = new InstrumentRow(instrument); instrumentRow.Height = this.dgvPanel.RowTemplate.Height; instrumentRow.ContextMenuStrip = this.dgvPanel.RowTemplate.ContextMenuStrip; this.dgvPanel.Rows.Add((DataGridViewRow) instrumentRow); this.instruments.Add(instrument, instrumentRow); if (!this.isRunning) return; this.RequestMarketData(new Instrument[1] { instrument }, this.GetMarketDataType()); }