public override void SaveInfo() { if (TargetProject == null) { return; } OpenedViewModel.ForEach(v => { if (v is IEditableViewModel) { if ((v as IEditableViewModel).IsChanged) { (v as IEditableViewModel).Save(); } } }); TargetProject.ConditionList.Clear(); foreach (var obj in ConditionList) { if (obj.TargetObject != null) { TargetProject.ConditionList.Add(obj.TargetObject); } } TargetProject.PredicateList.Clear(); foreach (var obj in PredicateList) { if (obj.TargetObject != null) { TargetProject.PredicateList.Add(obj.TargetObject); } } TargetProject.InstrumentList.Clear(); foreach (var obj in InstrumentList) { TargetProject.InstrumentList.Add(obj); } TargetProject.ResultList.Clear(); foreach (var obj in ResultList) { TargetProject.ResultList.Add(obj.TargetObject); } TargetProject.BlockList.Clear(); foreach (var v in BlockList) { TargetProject.BlockList.Add(v.TargetObject.Clone() as IInstrument); } IsChanged = false; TargetSummaryVM.Refresh(); }
public override void SaveInfo() { if (TargetProject == null) { return; } OpenedViewModel.ForEach(v => { if (v is IEditableViewModel) { if ((v as IEditableViewModel).IsChanged) { (v as IEditableViewModel).Save(); } } }); TargetProject.ConditionList.Clear(); foreach (var obj in ConditionList) { if (obj.TargetObject != null && obj.TargetObject is ICondition) { var c = obj.TargetObject as ICondition; TargetProject.ConditionList.Add(c); c.SaveToParameterList(); } } TargetProject.InstrumentList.Clear(); foreach (var obj in InstrumentList) { TargetProject.InstrumentList.Add(obj); } IsChanged = false; TargetSummaryVM.Refresh(); }