TriggerOrderVM - remove unnecessary overrides
This commit is contained in:
1 parent
95105d9e22
commit
ef2eb41893
1 file changed
+5
-16
@@ -4,7 +4,6 @@ using mbts.ui.utility;
|
||||
using mbts.utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using static bts.api.orderman.CustomOrderDefinition;
|
||||
@@ -148,11 +147,10 @@ namespace mbts.spark {
|
||||
}
|
||||
}
|
||||
|
||||
public override void init() {
|
||||
if (_child_order == null && security.HasValue)
|
||||
_select_child_order();
|
||||
_validate();
|
||||
}
|
||||
protected override CustomOneofCase _get_default_child_order_type() =>
|
||||
_inline_props != null && _inline_props.selected_child_order_type.has_value ?
|
||||
_inline_props.selected_child_order_type.value.key.type :
|
||||
base._get_default_child_order_type();
|
||||
|
||||
protected override void _on_security_changed(SecurityMD security_md) {
|
||||
base._on_security_changed(security_md);
|
||||
@@ -175,19 +173,10 @@ namespace mbts.spark {
|
||||
}
|
||||
}
|
||||
|
||||
void _select_child_order() {
|
||||
CustomOneofCase ot = _inline_props != null && _inline_props.selected_child_order_type.has_value ?
|
||||
_inline_props.selected_child_order_type.value.key.type :
|
||||
model.factory.default_order_type(security.Value, true);
|
||||
_select_child_order(ot);
|
||||
}
|
||||
|
||||
protected override void _validate() {
|
||||
assert(!use_fixed_price || !double.IsNaN(fixed_price), nameof(fixed_price));
|
||||
assert(!is_timeout_checked || timeout_secs > 0, nameof(timeout_secs));
|
||||
if (_child_order == null || (_child_order is INotifyDataErrorInfo ndei && ndei.HasErrors))
|
||||
set_error(nameof(child_order), string.Empty, true);
|
||||
else clear_error(nameof(child_order));
|
||||
base._validate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user