private void draw_bids(DOMPrice[] bids, dom_model _dom_model, Graphics _gr, double maxTotalVol) { const int _middle = c_levels / 2; var _max_size = bids.Max(_1 => _1.Size); for (var i = _middle; i < Math.Min(bids.Length + _middle, c_levels); ++i) { var _rc = _dom_model.Bid(i); var _size = bids[i - _middle].Size; draw_bg_gradientr2l(m_bid_clr, _gr, _rc, _max_size, _size); _gr.DrawString(Volume2String(_size), m_my_font, i == _middle ? Brushes.White : Brushes.Black, _rc, m_str_format); var _rc_p = _dom_model.Price(i); var _price = bids[i - _middle].Price; draw_bg_gradientl2r(m_tot_vol_clr, _gr, _rc_p, maxTotalVol, get_volume_for_price(_price)); _gr.DrawString(Price2String(_price, m_price_format), m_my_font, Brushes.Black, _rc_p, m_str_format); } }
private void draw_asks(DOMPrice[] asks, dom_model _dom_model, Graphics _gr, double maxTotalVol) { const int _middle = c_levels / 2 - 1; var _max_size = asks.Max(_1 => _1.Size); for (var i = _middle; i > Math.Max(_middle - asks.Length, 0); --i) { var _rc = _dom_model.Ask(i); var _size = asks[_middle - i].Size; draw_bg_gradientl2r(m_ask_clr, _gr, _rc, _max_size, _size); _gr.DrawString(Volume2String(_size), m_my_font, i == _middle ? Brushes.White : Brushes.Black, _rc, m_str_format); var _price = asks[_middle - i].Price; var _rc_p = _dom_model.Price(i); draw_bg_gradientl2r(m_tot_vol_clr, _gr, _rc_p, maxTotalVol, get_volume_for_price(_price)); _gr.DrawString(Price2String(_price, m_price_format), m_my_font, Brushes.Black, _rc_p, m_str_format); } }