refactor: Use VolSurfaceWindowFactory to create win
This commit is contained in:
1 parent
579e2a7a93
commit
d271e2a3ef
1 file changed
+1
-17
@@ -80,24 +80,8 @@
|
||||
return Task.FromResult<IShellWindow>(null);
|
||||
}
|
||||
|
||||
async Task<IShellWindow> get_main_window() {
|
||||
if (!ProtoBufSerializationHelper.try_deserialize(load_stream, out VolSurfaceWindowSettings ws)) {
|
||||
return null;
|
||||
}
|
||||
if (ws.vol_curve_visible_series == null) {
|
||||
ws.vol_curve_visible_series = new List<VolSurfaceExpiration>();
|
||||
}
|
||||
if (ws.hidden_exps == null) {
|
||||
ws.hidden_exps = new List<VolSurfaceExpiration>();
|
||||
}
|
||||
if (ws.macro_grid_settings == null) {
|
||||
ws.macro_grid_settings = new VolSurfaceMacroGridSettings();
|
||||
}
|
||||
return new VolSurfaceWindow(_vol_surface_window_factory, _bus, await _get_vs_name(ws.id), ws);
|
||||
}
|
||||
|
||||
if (header.name == MAIN_WINDOW_HEADER) {
|
||||
return get_main_window();
|
||||
return _vol_surface_window_factory.load_window(load_stream, header.version);
|
||||
} else if (header.name == ANALYTICS_EXPIRATION_PARAMETERS_HEADER &&
|
||||
ProtoBufSerializationHelper.try_deserialize(load_stream, out AnalyticsExpirationParametersVM.StartupData startup_data)) {
|
||||
return Task.FromResult<IShellWindow>(new AnalyticsExpirationParametersWindow(_bus, _exp_params_window_factory, startup_data));
|
||||
|
||||
Reference in new issue
Block a user