public override void RecoverySerialObject() { ConditionList.Clear(); ConditionSerialList.ForEach(v => { var i = v.CreateInstance(BacktestingResource.CommonResource.ConditionPrototypeList.Cast <ISerialSupport>().ToList()); if (i != null) { ConditionList.Add(i as ICondition); } }); PredicateList.Clear(); PredicateSerialList.ForEach(v => { var i = v.CreateInstance(BacktestingResource.CommonResource.ConditionPrototypeList.Cast <ISerialSupport>().ToList()); if (i != null) { PredicateList.Add(i as ICondition); } }); }
public override void LoadInfo() { if (TargetProject == null) { return; } ConditionList.Clear(); TargetProject.ConditionList.ForEach(v => ConditionList.Add(new ConditionViewModel() { TargetObject = v })); PredicateList.Clear(); TargetProject.PredicateList.ForEach(v => PredicateList.Add(new ConditionViewModel() { TargetObject = v })); InstrumentList.Clear(); TargetProject.InstrumentList.ForEach(v => InstrumentList.Add(v)); ResultList.Clear(); TargetProject.ResultList.ForEach(v => ResultList.Add(new InstrumentViewModel() { TargetObject = v, GetCurrentDataSource = () => { return(CurrentDataSource); } })); TargetProject.BlockList.ForEach(v => BlockList.Add(new InstrumentViewModel() { TargetObject = v, GetCurrentDataSource = () => { return(CurrentDataSource); } })); CurrentDataSource = TargetProject.CurrentDataSource; IsChanged = false; if (TargetSummaryVM != null) { TargetSummaryVM.Refresh(); } }