From 235e8b397fd7011345afb73bd8ed392a8facaefa Mon Sep 17 00:00:00 2001 From: John Colvin Date: Fri, 19 Jan 2018 14:42:49 -0500 Subject: [PATCH] SPARK-266 create synthetic add/remove leg functionality; add SyntheticSpreadsMangement window; CreateSynthetic add/remove leg functionality --- src/client/spark/Images/Icons.cs | 3 + src/client/spark/Images/Vector/Icons.xaml | 777 +++++++++--------- .../Market/MarketView/MarketViewWindow.cs | 2 +- .../Market/TimeAndSales/TimeAndSalesWindow.cs | 2 +- ...itor.xaml => ExecutionStrategyEditor.xaml} | 57 +- ...aml.cs => ExecutionStrategyEditor.xaml.cs} | 93 ++- ...cs => ExecutionStrategyGridLineAdorner.cs} | 11 +- .../Spreader/ShowSyntheticEditorHandler.cs | 26 +- .../spark/Modules/Spreader/SpreaderModel.cs | 28 +- .../Modules/Spreader/SpreaderShellModule.cs | 33 +- ...alog.xaml => SyntheticCreationDialog.xaml} | 14 +- .../Spreader/SyntheticCreationDialog.xaml.cs | 14 + .../Spreader/SyntheticEditorDialog.xaml.cs | 14 - .../Spreader/SyntheticManagementView.xaml | 35 + .../Spreader/SyntheticManagementView.xaml.cs | 13 + .../Spreader/SyntheticManagementWindow.cs | 55 ++ .../SyntheticManagementWindowFactory.cs | 58 ++ .../spark/Modules/Spreader/VM/RowModel.cs | 2 +- src/client/spark/Modules/Spreader/VM/RowVM.cs | 30 +- .../Modules/Spreader/VM/SyntheticEditorVM.cs | 32 +- .../VM/SyntheticManagementDialogVM.cs | 53 ++ .../Modules/Trading/Fills/FillsWindow.cs | 2 +- src/client/spark/core/Bus/SparkCommands.cs | 9 +- src/client/spark/core/Bus/SparkTags.cs | 3 +- .../GenericCollectionExtensions.cs | 20 + .../core/GlobalExtensions/GlobalExtensions.cs | 17 +- .../spark/core/Utility/ObservantDictionary.cs | 67 ++ .../view/Controls/DataGridEx/DataGridEx.cs | 36 +- .../Filters/IDataGridColumnFilter.cs | 39 +- .../DataGridEx/Model/IHandleCellSelection.cs | 8 +- .../DataGridEx/Model/IHandleRowSelection.cs | 18 + .../DialogSkirts/DialogSkirtOKCancel.xaml | 2 +- .../DialogSkirts/DialogSkirtOKCancel.xaml.cs | 2 + src/client/spark/view/Resources/Buttons.xaml | 4 +- src/client/spark/view/Resources/DataGrid.xaml | 11 +- .../ContractPicker/ContractPickerView.xaml | 3 +- .../ContractPicker/ContractPickerView.xaml.cs | 8 +- .../spark/view/Spark/Core/SparkUtils.cs | 8 + .../spark/view/Spark/Grid/SecurityGrid.cs | 67 +- .../spark/view/Spark/Grid/SecurityMDGrid.cs | 5 + 40 files changed, 1119 insertions(+), 562 deletions(-) rename src/client/spark/Modules/Spreader/{SyntheticEditor.xaml => ExecutionStrategyEditor.xaml} (83%) rename src/client/spark/Modules/Spreader/{SyntheticEditor.xaml.cs => ExecutionStrategyEditor.xaml.cs} (64%) rename src/client/spark/Modules/Spreader/{SyntheticEditorGridLineAdorner.cs => ExecutionStrategyGridLineAdorner.cs} (69%) rename src/client/spark/Modules/Spreader/{SyntheticEditorDialog.xaml => SyntheticCreationDialog.xaml} (57%) create mode 100644 src/client/spark/Modules/Spreader/SyntheticCreationDialog.xaml.cs delete mode 100644 src/client/spark/Modules/Spreader/SyntheticEditorDialog.xaml.cs create mode 100644 src/client/spark/Modules/Spreader/SyntheticManagementView.xaml create mode 100644 src/client/spark/Modules/Spreader/SyntheticManagementView.xaml.cs create mode 100644 src/client/spark/Modules/Spreader/SyntheticManagementWindow.cs create mode 100644 src/client/spark/Modules/Spreader/SyntheticManagementWindowFactory.cs create mode 100644 src/client/spark/Modules/Spreader/VM/SyntheticManagementDialogVM.cs create mode 100644 src/client/spark/core/Utility/ObservantDictionary.cs create mode 100644 src/client/spark/view/Controls/DataGridEx/Model/IHandleRowSelection.cs diff --git a/src/client/spark/Images/Icons.cs b/src/client/spark/Images/Icons.cs index b3e9ec944..b97a49b55 100644 --- a/src/client/spark/Images/Icons.cs +++ b/src/client/spark/Images/Icons.cs @@ -68,9 +68,12 @@ namespace mbts.ui public static ImageSource Window { get { return (DrawingImage)_resources["Window"]; } } public static ImageSource ActiveWindow { get { return (DrawingImage)_resources["ActiveWindow"]; } } public static ImageSource Trash { get { return (DrawingImage)_resources["Trash"]; } } + public static ImageSource Trash2 { get { return (DrawingImage)_resources["Trash2"]; } } public static ImageSource Crucible { get { return (DrawingImage)_resources["Crucible"]; } } public static ImageSource Accounting { get { return (DrawingImage)_resources["Accounting"]; } } + public static ImageSource Add { get { return (DrawingImage)_resources["Add"]; } } + public static ImageSource AddEncircled { get { return (DrawingImage)_resources["AddEncircled"]; } } public static ImageSource Beaker { get { return (DrawingImage)_resources["Beaker"]; } } public static ImageSource Book { get { return (DrawingImage)_resources["Book"]; } } public static ImageSource CancelOrders { get { return (DrawingImage)_resources["CancelOrders"]; } } diff --git a/src/client/spark/Images/Vector/Icons.xaml b/src/client/spark/Images/Vector/Icons.xaml index 2db7fb194..dedf416bf 100644 --- a/src/client/spark/Images/Vector/Icons.xaml +++ b/src/client/spark/Images/Vector/Icons.xaml @@ -2,258 +2,272 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -283,7 +297,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z"> - + @@ -324,6 +338,30 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z"> + + + + + + + + + + + + + + + + + + + + + + + + @@ -382,7 +420,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z"> - + @@ -403,7 +441,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z"> - + @@ -425,159 +463,156 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z"> - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - + + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + - - - - + + + + - - - - - + + + + - - - - + + + + - - - - - - + + + + + - - - - + + + + - - - - - - + + + + + - - - - + + + + - - - - - - + + + + + - - - - + + + + - - - - - + + + + - - - - + + + + - - - - - + + + + - - - - + + + + - - - - - + + + + - - - - + + + + - - - - - + + + + - - - - - - - - - - + diff --git a/src/client/spark/Modules/Market/MarketView/MarketViewWindow.cs b/src/client/spark/Modules/Market/MarketView/MarketViewWindow.cs index c4cde1e3d..51da1b177 100644 --- a/src/client/spark/Modules/Market/MarketView/MarketViewWindow.cs +++ b/src/client/spark/Modules/Market/MarketView/MarketViewWindow.cs @@ -36,7 +36,7 @@ namespace mbts.spark SparkCommands.ShowTimeAndSales.complete(_vm.Observable.SelectMany(vm => vm.selected_securities_observable()), secs => secs.Count > 0, secs => new SecurityCriteria(secs)), // SpreadMatrix ?? // SyntheticCreate - SparkCommands.ShowSyntheticSpreads, + SparkCommands.ShowSyntheticManagement, SparkCommands.ShowSyntheticCreate.complete(_vm.Observable.SelectMany(vm => vm.selected_securities_observable()), secs => secs.Count > 0, secs => new SecurityCriteria(secs)) // ModifyOrder - await orders // CancelOrdersRoot ? diff --git a/src/client/spark/Modules/Market/TimeAndSales/TimeAndSalesWindow.cs b/src/client/spark/Modules/Market/TimeAndSales/TimeAndSalesWindow.cs index 2986c8f3d..e2e72361e 100644 --- a/src/client/spark/Modules/Market/TimeAndSales/TimeAndSalesWindow.cs +++ b/src/client/spark/Modules/Market/TimeAndSales/TimeAndSalesWindow.cs @@ -38,7 +38,7 @@ namespace mbts.spark SparkCommands.ShowMarketView.complete(_vm.Observable.SelectMany(vm => vm.selected_securities_observable()), secs => secs.Count > 0, secs => new SecurityCriteria(secs)), // SpreadMatrix ?? // SyntheticCreate - SparkCommands.ShowSyntheticSpreads, + SparkCommands.ShowSyntheticManagement, // ModifyOrder - await orders // CancelOrdersRoot ? //SparkCommands.CancelBuyOrders, diff --git a/src/client/spark/Modules/Spreader/SyntheticEditor.xaml b/src/client/spark/Modules/Spreader/ExecutionStrategyEditor.xaml similarity index 83% rename from src/client/spark/Modules/Spreader/SyntheticEditor.xaml rename to src/client/spark/Modules/Spreader/ExecutionStrategyEditor.xaml index 26c5e0dc0..ba181b563 100644 --- a/src/client/spark/Modules/Spreader/SyntheticEditor.xaml +++ b/src/client/spark/Modules/Spreader/ExecutionStrategyEditor.xaml @@ -1,6 +1,7 @@  + @@ -190,7 +192,7 @@ - + @@ -200,9 +202,30 @@ - + - + + + + + + + + + + + + + +