From c7e3bdcd6cc1ad2e3897d979507a9d1ca384f70d Mon Sep 17 00:00:00 2001 From: John Colvin Date: Thu, 9 May 2019 11:18:27 -0500 Subject: [PATCH] OrderBookRowVM - normalize spacing --- .../Trading/OrderBook/OrderBookRowVM.cs | 28 ++++--------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/src/client/spark/Modules/Trading/OrderBook/OrderBookRowVM.cs b/src/client/spark/Modules/Trading/OrderBook/OrderBookRowVM.cs index d16edf8fb..650e5c0d2 100644 --- a/src/client/spark/Modules/Trading/OrderBook/OrderBookRowVM.cs +++ b/src/client/spark/Modules/Trading/OrderBook/OrderBookRowVM.cs @@ -24,13 +24,10 @@ namespace mbts.spark { bool _is_parent, _is_expanded, _is_selected, _is_attachable, _is_detachable; int _depth_level; SecurityImmutable? _security => order_tuple.security; - - // for mini-ob uint _prospective_quantity; double _prospective_price; - public OrderBookRowVM(OrderBookVM owner, OrderSecurityAlgoMeta order_tuple, bool is_expanded) { _owner = owner; this.order_tuple = order_tuple; @@ -172,30 +169,16 @@ namespace mbts.spark { } } + public ICommand revert_prospective_order_quantity_andor_price => _revert_prospective_order_quantity_andor_price ?? + (_revert_prospective_order_quantity_andor_price = new DelegateCommand( () => { - if (is_qty_dirty && is_price_dirty) { - _owner.modify_order_price_and_quantity(this, prospective_price, prospective_quantity); - } else if (is_qty_dirty) { - _owner.modify_order_quantity(this, prospective_quantity); - } else if (is_price_dirty) { - _owner.modify_order_price(this, this.prospective_price); - } - _unselect_me(); - }, + prospective_price = price; + prospective_quantity = quantity; + }, () => this.status == OrderStatus.Working && (is_price_dirty || is_qty_dirty) ) ); - public ICommand revert_prospective_order_quantity_andor_price => _revert_prospective_order_quantity_andor_price ?? - (_revert_prospective_order_quantity_andor_price = new DelegateCommand( - () => { - prospective_price = price; - prospective_quantity = quantity; - }, - () => this.status == OrderStatus.Working && (is_price_dirty || is_qty_dirty) - ) -); - public ICommand detach_command => _detach_command ?? (_detach_command = new DelegateCommand(() => { _owner.detach_orders(this); @@ -331,7 +314,6 @@ namespace mbts.spark { // this will update the cancel column in the mini ob cancel_command.TryRaiseCanExecuteChanged(); } - // always refresh attach and detach b/c // conditionally raise invalidated if ((dirty & ViewRefresh.invalidate_mask) != 0)