diff --git a/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs b/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs index 297cf49d9..8af2dcfdf 100644 --- a/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs +++ b/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs @@ -73,7 +73,7 @@ namespace mbts.spark { _has_working_orders = backing(nameof(has_working_orders), false); contract_picker_model = new ContractPickerModel(bus, false, null, new SecurityCriteria(new[] { new SecurityCriteriaClause() { - exchanges = EnumHelper.get_values_except(Venue.Bts).ToLArray() + exchanges = EnumHelper.get_values_except(Venue.Bts).ToArray() } })); contract_picker_model.cancel_action = _close_new_leg_popup; diff --git a/src/client/spark/Modules/Trading/TradingShellModule.cs b/src/client/spark/Modules/Trading/TradingShellModule.cs index 7408057bb..c5cf0da00 100644 --- a/src/client/spark/Modules/Trading/TradingShellModule.cs +++ b/src/client/spark/Modules/Trading/TradingShellModule.cs @@ -6,6 +6,7 @@ using mbts.ui; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; +using System.Linq; using System.Threading.Tasks; using System.Windows.Media; using static mbts.ui.shell.ProtoBufSerializationHelper; @@ -52,9 +53,8 @@ namespace bts.shell { yield return _aswf; } - public Task create(Stream load_stream) { - return dispatch_to_factory(load_stream, window_factories().ToLArray()); - } + public Task create(Stream load_stream) => + dispatch_to_factory(load_stream, window_factories().ToArray()); public void Dispose() { foreach (var i in window_factories()) diff --git a/src/client/spark/core/Collections/ObservantDictionary.cs b/src/client/spark/core/Collections/ObservantDictionary.cs index cd05ae51d..b63029364 100644 --- a/src/client/spark/core/Collections/ObservantDictionary.cs +++ b/src/client/spark/core/Collections/ObservantDictionary.cs @@ -42,7 +42,7 @@ namespace mbts.collections foreach (TModel m in e.OldItems) _remove(m); break; case NotifyCollectionChangedAction.Reset: - var old_views = Values.ToLArray(); + var old_views = Values.ToArray(); Clear(); foreach (TValue v in old_views) ValueDestroyed?.Invoke(v); foreach (TModel m in _models) _add(m); diff --git a/src/client/spark/view/Controls/DataGridEx/Filters/VM/DiscreteValuesFilterVM.cs b/src/client/spark/view/Controls/DataGridEx/Filters/VM/DiscreteValuesFilterVM.cs index fbc33e8e5..5eb943e76 100644 --- a/src/client/spark/view/Controls/DataGridEx/Filters/VM/DiscreteValuesFilterVM.cs +++ b/src/client/spark/view/Controls/DataGridEx/Filters/VM/DiscreteValuesFilterVM.cs @@ -3,17 +3,14 @@ using bts.collections; using bts.utils; using mbts.collections; using mbts.ui.shell; -using mbts.ui.utilities; using mbts.ui.utility; using System; -using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; using System.Linq; using System.Reactive.Linq; -using System.Windows.Data; namespace mbts.spark.filters { static class DiscreteValuesFilterVM { @@ -87,7 +84,7 @@ namespace mbts.spark.filters { public IReadOnlyCollection items { get; } public ObservableCollectionEx selected_items { get; } = new ObservableCollectionEx(); - public override TValue[] get_state() => selected_items.ToLArray(); + public override TValue[] get_state() => selected_items.ToArray(); protected override void _clear() { _destroy_snapshot(); selected_items.Clear(); diff --git a/src/client/spark_core/Collections/Extensions/EnumerableExtensions.cs b/src/client/spark_core/Collections/Extensions/EnumerableExtensions.cs index 6f7d59c46..d2f85f273 100644 --- a/src/client/spark_core/Collections/Extensions/EnumerableExtensions.cs +++ b/src/client/spark_core/Collections/Extensions/EnumerableExtensions.cs @@ -30,11 +30,8 @@ namespace System.Collections.Generic { public static IEnumerable OfTypeSafe(this IEnumerable source) => source == null ? Enumerable.Empty() : source.OfType(); - public static T[] ToLArray(this IEnumerable enumerable) => - enumerable.ToList().ToArray(); - public static TAccumulate AggregateWhile(this IEnumerable source, TAccumulate seed, Func aggregate, Func predicate) => - AggregateWhile(source, seed, aggregate, predicate, (curr, el, next) => curr); + AggregateWhile(source, seed, aggregate, predicate, (curr, el, next) => curr); public static TAccumulate AggregateWhile(this IEnumerable source, TAccumulate seed, Func aggregate, Func predicate, TAccumulate early_break_rv) => AggregateWhile(source, seed, aggregate, predicate, (curr, el, next) => early_break_rv);