void IPersistable.Load(SettingsStorage storage) { if (storage.ContainsKey("TaskId")) { var taskId = storage.GetValue <Guid>("TaskId"); Task = MainWindow.Instance.Tasks.SingleOrDefault(s => s.Settings.Id == taskId); } SecuritiesCtrl.Load(storage.GetValue <SettingsStorage>("Securities")); }
/// <summary> /// Load settings. /// </summary> /// <param name="storage">Settings storage.</param> public void Load(SettingsStorage storage) { var gridSettings = storage.GetValue <SettingsStorage>("GridSettings"); if (gridSettings != null) { SecuritiesCtrl.Load(gridSettings); } SecurityFilter = storage.GetValue <string>("SecurityFilter"); SelectedType = storage.GetValue <string>("SecurityType").To <SecurityTypes?>(); }