Merged in SPARK-1560 (pull request #93)

SPARK-1560 Synthetic Management browser maintain order

Approved-by: Jake Norbut <jake.norbut@bluetradesys.com>
Approved-by: John Colvin <john.colvin@bluetradesys.com>
This commit is contained in:
John Colvin committed 2018-11-06 20:43:54 +00:00
commit c056bfcf7a
1 file changed
+3 -6
@@ -2,7 +2,6 @@
using bts.shell;
using bts.spark;
using bts.utils;
using mbts.spark.utilities;
using mbts.ui;
using mbts.ui.shell;
using mbts.ui.spark;
@@ -110,7 +109,7 @@ namespace mbts.spark {
_validate_leg_count();
};
async Task commit_async(){
async Task commit_async() {
RequestUpdate?.Invoke();
bool valid = true;
if (string.IsNullOrWhiteSpace(name)) {
@@ -125,8 +124,7 @@ namespace mbts.spark {
valid = false;
}
if (valid) {
_synthetic.Synthetic.Legs.Clear();
_synthetic.Synthetic.Legs.AddRange(leg_tuples.Select(l => l.leg).OrderBy(l => l.Security, SecurityHelper.Comparer.Instance));
_synthetic.Synthetic.Legs.SetItems(leg_tuples.Select(l => l.leg));
_synthetic.Symbol = _deduce_symbol(_synthetic);
double tick_frac = _tick_factors.tick_unit / _tick_factors.tick_base;
_synthetic.ContractSpec.LowTick = tick_frac;
@@ -296,7 +294,6 @@ namespace mbts.spark {
static IEnumerable<LegSpreaderParamsTuple> _get_legs(Security synthetic, ExecutionStrategyImmutable strategy) =>
synthetic.Synthetic.Legs
.OrderBy(l => l.Security, SecurityHelper.Comparer.Instance)
.Select(l => new LegSpreaderParamsTuple(l, strategy.LegParamsMap[l.Security.Id].Clone()));
void _close_new_leg_popup() {
@@ -339,4 +336,4 @@ namespace mbts.spark {
else clear_error(nameof(leg_count));
}
}
}
}