diff --git a/src/client/spark/view/Spark/Grid/SecurityGrid.cs b/src/client/spark/view/Spark/Grid/SecurityGrid.cs index 562e91fd6..a2c320263 100644 --- a/src/client/spark/view/Spark/Grid/SecurityGrid.cs +++ b/src/client/spark/view/Spark/Grid/SecurityGrid.cs @@ -80,32 +80,6 @@ namespace mbts.spark } } - abstract class SecurityGrid : SecurityGridBase, IHandleCellSelection where TRow : class, ISecurityRow - { - protected SecurityGrid(IObservable> row_models, IEnumerable sorting_criteria) - : this(RXCollection.Create(row_models), sorting_criteria) { } - - protected SecurityGrid(IObservable> row_models, IEqualityComparer comparer, IEnumerable sorting_criteria) - : this(RXCollection.Create(row_models, comparer), sorting_criteria) { } - - protected SecurityGrid(IRXCollection row_models, IEnumerable sorting_criteria) : base(row_models, sorting_criteria) => - _current_cell = backing(nameof(current_cell)); - - readonly Property _current_cell; - IDictionary> _selection_map = new Dictionary>(); - - public DataGridCellInfo current_cell { - get => _current_cell.Value; - set { if (value.IsValid) _current_cell.Value = value; } - } - public override TRow current_row => _current_cell.Value.Item as TRow ?? selected_rows.FirstOrDefault(); - public override IObservable current_row_observable => _current_cell.Select(v => v.newval.Item as TRow); - public IDictionary> get_selection_map() => new Dictionary>(_selection_map); - - void IHandleCellSelection.cell_selection_changed(IList added, IList removed) => - CellSelectionMapper.apply_changes(_selection_map, added, removed, selected_rows); - } - static class SecurityGridExtensions { public static IObservable current_security_md_observable(this SecurityGridBase security_grid, IBus bus) diff --git a/src/client/spark/view/Spark/Grid/SecurityMDGrid.cs b/src/client/spark/view/Spark/Grid/SecurityMDGrid.cs index 77d1aeb29..9a6febf02 100644 --- a/src/client/spark/view/Spark/Grid/SecurityMDGrid.cs +++ b/src/client/spark/view/Spark/Grid/SecurityMDGrid.cs @@ -21,16 +21,4 @@ namespace mbts.spark public IObservable current_security_md => current_row_observable.Select(r => r?.md).DistinctUntilChanged(EqualityComparer.CreateNullable(md => md.security.Id)); } - - abstract class SecurityMDGrid : SecurityGrid where TRow : class, ISecurityMDRow - { - protected SecurityMDGrid(IObservable> row_models, IEnumerable sorting_criteria) - : base(row_models, sorting_criteria) { } - - protected SecurityMDGrid(IObservable> row_models, IEqualityComparer comparer, IEnumerable sorting_criteria) - : base(row_models, comparer, sorting_criteria) { } - - public IObservable current_security_md => - current_row_observable.Select(r => r?.md).DistinctUntilChanged(EqualityComparer.CreateNullable(md => md.security.Id)); - } } \ No newline at end of file