simplifying Attach columm insertion

This commit is contained in:
Jake Norbut committed 2019-03-28 09:33:19 -05:00
1 parent 33552c0720
commit 4900a73eeb
1 file changed
+4 -12
@@ -248,10 +248,11 @@ namespace mbts.spark {
// if these EditXXX ever support settings.
// The end result after this group of lines will be
// ------------------------
// | Cancel | Qty | Price | ...
// ------------------------
// -----------------------------------
// | Cancel | Qty | Price | Attach ...
// -----------------------------------
//
obvm.columns.Insert(0, new OrderBookVM.AttachColumn(typeof(MiniOrderBookView)));
var price_col = obvm.columns.FirstOrDefault(x => x.id == OrderBookGridView.ColumnKeys.Price.ToString());
var price_index = obvm.columns.indexOf(price_col);
if (price_index > -1) {
@@ -274,15 +275,6 @@ namespace mbts.spark {
}
obvm.columns.Insert(0, new OrderBookVM.CancelColumn(nameof(OrderBookRowVM.cancel_command)));
// now let's shoehorn an attach column in
//
// also just in case we'll make sure we have at least 4 columns in here so that
// inserting at pos 3 won't be an issue
// (maybe in the future someone has customized the mini ob column collection to be small)
if (obvm.columns.Count > 3) {
obvm.columns.Insert(3, new OrderBookVM.AttachColumn(typeof(MiniOrderBookView)));
}
obvm.load_from(state);
return obvm;
}