public static void SerializePostprocessorOutput( IEnumerable <TSBlocks.TimeSeriesData> series, IEnumerable <TSBlocks.EventBase> events, string outputFileName, TSBlocks.ITimeSeriesTypesAccess timeSeriesTypesAccess) { using (var writer = XmlWriter.Create(outputFileName)) { writer.WriteStartElement("Data"); timeSeriesTypesAccess.GetEventsSerializer().Serialize(writer, events.ToList()); timeSeriesTypesAccess.GetSeriesSerializer().Serialize(writer, series.ToList()); writer.WriteEndElement(); } }
public static async Task SerializePostprocessorOutput( IEnumerable <TSBlocks.TimeSeriesData> series, IEnumerable <TSBlocks.EventBase> events, Func <Task <Stream> > openOutputStream, TSBlocks.ITimeSeriesTypesAccess timeSeriesTypesAccess) { using (var stream = await openOutputStream()) using (var writer = XmlWriter.Create(stream)) { writer.WriteStartElement("Data"); timeSeriesTypesAccess.GetEventsSerializer().Serialize(writer, events.ToList()); timeSeriesTypesAccess.GetSeriesSerializer().Serialize(writer, series.ToList()); writer.WriteEndElement(); } }
public TimeSeriesPostprocessorOutput(LogSourcePostprocessorDeserializationParams p, ILogPartTokenFactory rotatedLogPartFactory, TSBlocks.ITimeSeriesTypesAccess timeSeriesTypesAccess) { this.logSource = p.LogSource; logDisplayName = logSource.DisplayName; p.Reader.ReadStartElement(); events = (List <TSBlocks.EventBase>)timeSeriesTypesAccess.GetEventsSerializer().Deserialize(p.Reader); timeSeries = (List <TSBlocks.TimeSeriesData>)timeSeriesTypesAccess.GetSeriesSerializer().Deserialize(p.Reader); timeSeries.ForEach(Sanitize); }