private async Task <ObservedDataCurveOptions[]> curveOptionSnapshotsFrom(ModelObservedDataCollection observedDataCollection) { var allObservedDatacoluns = observedDataCollection.AllObservedData().SelectMany(x => x.AllButBaseGrid()) .Where(observedDataCollection.HasCurveOptionsFor) .Select(x => new { Path = x.PathAsString, CurveOptions = observedDataCollection.ObservedDataCurveOptionsFor(x), }); var list = new List <ObservedDataCurveOptions>(); foreach (var column in allObservedDatacoluns) { var curveOptions = column.CurveOptions; list.Add(new ObservedDataCurveOptions { Caption = SnapshotValueFor(curveOptions.Caption), Path = column.Path, CurveOptions = await _curveOptionsMapper.MapToSnapshot(curveOptions.CurveOptions) }); } return(list.ToArray()); }
public override async Task <SnapshotCurve> MapToSnapshot(ModelCurve curve) { var snapshot = await SnapshotFrom(curve, x => { x.Name = SnapshotValueFor(curve.Name); x.X = curve.xData?.PathAsString; x.Y = curve.yData?.PathAsString; }); snapshot.CurveOptions = await _curveOptionsMapper.MapToSnapshot(curve.CurveOptions); return(snapshot); }