private void RemoveInstruments(Instrument[] array) { foreach (Instrument instrument1 in array) { Instrument instrument2 = instrument1; // QuoteMonitorWindow quoteMonitorWindow1 = this; // // ISSUE: virtual method pointer // IntPtr num1 = __vmethodptr(quoteMonitorWindow1, OnNewQuote); // QuoteEventHandler quoteEventHandler = new QuoteEventHandler( quoteMonitorWindow1, num1); // instrument2.NewQuote -= new QuoteEventHandler(this.OnNewQuote); Instrument instrument3 = instrument1; // QuoteMonitorWindow quoteMonitorWindow2 = this; // // ISSUE: virtual method pointer // IntPtr num2 = __vmethodptr(quoteMonitorWindow2, OnNewTrade); // TradeEventHandler tradeEventHandler = new TradeEventHandler(quoteMonitorWindow2, num2); instrument3.NewTrade -= new TradeEventHandler(this.OnNewTrade); Instrument instrument4 = instrument1; // QuoteMonitorWindow quoteMonitorWindow3 = this; // // ISSUE: virtual method pointer // IntPtr num3 = __vmethodptr(quoteMonitorWindow3, OnNewBar); // BarEventHandler barEventHandler = new BarEventHandler(quoteMonitorWindow3, num3); instrument4.NewBar -= new BarEventHandler(this.OnNewBar); lock (this.lockObject) { this.instruments.Remove(instrument1); QuoteViewRow local_1 = this.quoteRows[(IFIXInstrument)instrument1]; this.quoteRows.Remove((IFIXInstrument)instrument1); local_1.Disconnect(); this.dgvQuotes.Rows.Remove((DataGridViewRow)local_1); BarViewRow local_2 = this.barRows[(IFIXInstrument)instrument1]; this.barRows.Remove((IFIXInstrument)instrument1); local_2.Disconnect(); this.dgvBars.Rows.Remove((DataGridViewRow)local_2); } } if ((int)((IProvider)this.marketDataProvider).Id == 1) { return; } ThreadPool.QueueUserWorkItem((WaitCallback)(obj => { foreach (Instrument item_1 in (Instrument[])obj) { Global.ProviderHelper.CancelMarketData(this.marketDataProvider, item_1, (MarketDataType)3); } }), (object)array); }
private void AddInstruments(Instrument[] array) { List <Instrument> list = new List <Instrument>(); foreach (Instrument instrument1 in array) { bool flag = false; lock (this.lockObject) { if (this.instruments.Add(instrument1)) { QuoteViewRow local_3 = new QuoteViewRow(instrument1); this.dgvQuotes.Rows.Add((DataGridViewRow)local_3); local_3.Height = this.dgvQuotes.RowTemplate.Height; local_3.ContextMenuStrip = this.dgvQuotes.RowTemplate.ContextMenuStrip; this.quoteRows.Add((IFIXInstrument)instrument1, local_3); BarViewRow local_4 = new BarViewRow(instrument1); this.dgvBars.Rows.Add((DataGridViewRow)local_4); local_4.Height = this.dgvBars.RowTemplate.Height; this.barRows.Add((IFIXInstrument)instrument1, local_4); flag = true; } } if (flag) { list.Add(instrument1); Instrument instrument2 = instrument1; // QuoteMonitorWindow quoteMonitorWindow1 = this; // // ISSUE: virtual method pointer // IntPtr num1 = __vmethodptr(quoteMonitorWindow1, OnNewQuote); // QuoteEventHandler quoteEventHandler = new QuoteEventHandler(quoteMonitorWindow1, num1); // instrument2.NewQuote += quoteEventHandler; instrument2.NewQuote += new QuoteEventHandler(this.OnNewQuote); Instrument instrument3 = instrument1; // QuoteMonitorWindow quoteMonitorWindow2 = this; // // ISSUE: virtual method pointer // IntPtr num2 = __vmethodptr(quoteMonitorWindow2, OnNewTrade); // TradeEventHandler tradeEventHandler = new TradeEventHandler(quoteMonitorWindow2, num2); instrument3.NewTrade += new TradeEventHandler(this.OnNewTrade); Instrument instrument4 = instrument1; // QuoteMonitorWindow quoteMonitorWindow3 = this; // // ISSUE: virtual method pointer // IntPtr num3 = __vmethodptr(quoteMonitorWindow3, OnNewBar); // BarEventHandler barEventHandler = new BarEventHandler(quoteMonitorWindow3, num3); // instrument4.NewBar += new BarEventHandler(this.OnNewBar); } } if ((int)((IProvider)this.marketDataProvider).Id == 1) { return; } ThreadPool.QueueUserWorkItem((WaitCallback)(obj => { using (IEnumerator <Instrument> resource_0 = ((IEnumerable <Instrument>)obj).GetEnumerator()) { while (((IEnumerator)resource_0).MoveNext()) { Global.ProviderHelper.RequestMarketData(this.marketDataProvider, resource_0.Current, (MarketDataType)3); } } }), (object)list); }
private void AddInstruments(Instrument[] array) { List<Instrument> list = new List<Instrument>(); foreach (Instrument instrument1 in array) { bool flag = false; lock (this.lockObject) { if (this.instruments.Add(instrument1)) { QuoteViewRow local_3 = new QuoteViewRow(instrument1); this.dgvQuotes.Rows.Add((DataGridViewRow)local_3); local_3.Height = this.dgvQuotes.RowTemplate.Height; local_3.ContextMenuStrip = this.dgvQuotes.RowTemplate.ContextMenuStrip; this.quoteRows.Add((IFIXInstrument)instrument1, local_3); BarViewRow local_4 = new BarViewRow(instrument1); this.dgvBars.Rows.Add((DataGridViewRow)local_4); local_4.Height = this.dgvBars.RowTemplate.Height; this.barRows.Add((IFIXInstrument)instrument1, local_4); flag = true; } } if (flag) { list.Add(instrument1); Instrument instrument2 = instrument1; // QuoteMonitorWindow quoteMonitorWindow1 = this; // // ISSUE: virtual method pointer // IntPtr num1 = __vmethodptr(quoteMonitorWindow1, OnNewQuote); // QuoteEventHandler quoteEventHandler = new QuoteEventHandler(quoteMonitorWindow1, num1); // instrument2.NewQuote += quoteEventHandler; instrument2.NewQuote += new QuoteEventHandler(this.OnNewQuote); Instrument instrument3 = instrument1; // QuoteMonitorWindow quoteMonitorWindow2 = this; // // ISSUE: virtual method pointer // IntPtr num2 = __vmethodptr(quoteMonitorWindow2, OnNewTrade); // TradeEventHandler tradeEventHandler = new TradeEventHandler(quoteMonitorWindow2, num2); instrument3.NewTrade += new TradeEventHandler(this.OnNewTrade); Instrument instrument4 = instrument1; // QuoteMonitorWindow quoteMonitorWindow3 = this; // // ISSUE: virtual method pointer // IntPtr num3 = __vmethodptr(quoteMonitorWindow3, OnNewBar); // BarEventHandler barEventHandler = new BarEventHandler(quoteMonitorWindow3, num3); // instrument4.NewBar += new BarEventHandler(this.OnNewBar); } } if ((int)((IProvider)this.marketDataProvider).Id == 1) return; ThreadPool.QueueUserWorkItem((WaitCallback)(obj => { using (IEnumerator<Instrument> resource_0 = ((IEnumerable<Instrument>)obj).GetEnumerator()) { while (((IEnumerator)resource_0).MoveNext()) Global.ProviderHelper.RequestMarketData(this.marketDataProvider, resource_0.Current, (MarketDataType)3); } }), (object)list); }