From a83f97e1ef18b20a18c1ddbbed2ce0cc8c75434a Mon Sep 17 00:00:00 2001 From: John Colvin Date: Tue, 6 Nov 2018 13:54:25 -0600 Subject: [PATCH] SPARK-1560 Synthetic Management browser maintain order --- .../spark/Modules/Spreader/VM/SyntheticEditorVM.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs b/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs index 2b162676a..7f294ab6c 100644 --- a/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs +++ b/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs @@ -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 _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)); } } -} +} \ No newline at end of file