Symbol Column filter is now a Discrete values; added new column to saved filter settings
This commit is contained in:
1 parent
0432fc0f3d
commit
64009e64fc
3 files changed
+11
-9
No files matched your search
@@ -58,13 +58,14 @@ namespace mbts.spark {
|
||||
SecurityHelper.Comparer.InstanceImmutable
|
||||
)));
|
||||
// symbol
|
||||
Add(symbol_column = new SimpleTextColumn<string>(
|
||||
Add(symbol_column = new SimpleTextColumn<string[]>(
|
||||
Columns.Symbol,
|
||||
DefaultColumnHeaders.Symbol,
|
||||
nameof(OrderBookRowVM.symbol),
|
||||
r => r.symbol.store,
|
||||
DefaultColumnWidths.Symbol,
|
||||
new RegexFilterVM<OrderBookRowVM>(
|
||||
DiscreteValuesFilterVM.Create<OrderBookRowVM, string>(
|
||||
mbts.co2.UserSymbol.get_all().Select(u => u.symbol).Distinct().ToList(),
|
||||
r => r.symbol.value,
|
||||
value_path(nameof(OrderBookRowVM.symbol))
|
||||
),
|
||||
@@ -216,7 +217,7 @@ namespace mbts.spark {
|
||||
DataGridFilterKnownTemplates.Regex));
|
||||
|
||||
string value_path(string cell_name) =>
|
||||
string.Join(".", cell_name, nameof(IOrderBookCell<uint>.value)); //uint is an arbitrary 'T', just want to get compile check on 'value' path.
|
||||
string.Join(".", cell_name, nameof(OrderBookRowVM.IOrderBookCell<uint>.value)); //uint is an arbitrary 'T', just want to get compile check on 'value' path.
|
||||
}
|
||||
|
||||
List<IDataGridColumnFilter<OrderBookRowVM>> _active_filters = new List<IDataGridColumnFilter<OrderBookRowVM>>(0);
|
||||
@@ -224,7 +225,7 @@ namespace mbts.spark {
|
||||
public event Action filter_changed;
|
||||
|
||||
public SecurityColumn security_column { get; }
|
||||
public SimpleTextColumn<string> symbol_column { get; }
|
||||
public SimpleTextColumn<string[]> symbol_column { get; }
|
||||
public TimeCreatedColumn time_created_column { get; }
|
||||
public LastChangeTimeColumn last_change_column { get; }
|
||||
public SimpleTextColumn<string[]> user_column { get; }
|
||||
@@ -267,7 +268,7 @@ namespace mbts.spark {
|
||||
exchange_message_regex = last_message_column.filter.get_state(),
|
||||
last_change = last_change_column.filter.get_state(),
|
||||
security_criteria = security_column.filter.get_state(),
|
||||
symbol = symbol_column.filter.get_state()
|
||||
symbols = symbol_column.filter.get_state()
|
||||
};
|
||||
|
||||
public void load_from(FilterStates fs) {
|
||||
@@ -276,7 +277,7 @@ namespace mbts.spark {
|
||||
c.filter.filter_changed -= _set_active_filters;
|
||||
//
|
||||
security_column.filter.load_state(fs.security_criteria);
|
||||
symbol_column.filter.load_state(fs.symbol);
|
||||
symbol_column.filter.load_state(fs.symbols);
|
||||
time_created_column.filter.load_state(fs.time_created);
|
||||
user_column.filter.load_state(fs.users);
|
||||
account_column.filter.load_state(fs.accounts);
|
||||
@@ -573,4 +574,4 @@ namespace mbts.spark {
|
||||
public static BindingBase get_font_weight_binding() => new Binding(nameof(OrderBookRowVM.is_child)) { Converter = _font_weight_converter };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -211,6 +211,7 @@ namespace mbts.spark {
|
||||
yield return _price_store;
|
||||
yield return _avg_price_store;
|
||||
yield return _last_price_store;
|
||||
yield return _symbol_store;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,4 +383,4 @@ namespace mbts.spark {
|
||||
return updated;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@ namespace bts.shell {
|
||||
[ProtoMember(19)]
|
||||
public api.orderman.OrderSubType[] order_sub_types;
|
||||
[ProtoMember(20)]
|
||||
public string symbol;
|
||||
public string[] symbols;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user