public override IEnumerable <PsaTraceInfo> GetAllTraces() { LexiaTracesData tracesData = GetAllTraceData(); foreach (LexiaTrace t in tracesData.Traces) { LexiaTraceToPsaTraceConverter converter = new LexiaTraceToPsaTraceConverter(t); PsaTrace trace = converter.Convert(); PsaTraceMetadata md = new PsaTraceMetadata(); md.Subtype = PsaConnectorSubtype.Trace; md.Connector = DiagnosticSystemType.PP2000; md.SourceXmlPath = t.SourceFilePath; if (String.IsNullOrEmpty(md.SourceXmlPath)) { throw new Exception("input file not defined!"); } PeugeotAdditionalFilePathSearcher searcher = new PeugeotAdditionalFilePathSearcher( PsaConnectorSubtype.Trace, md.SourceXmlPath); foreach (string filePath in searcher.Search()) { md.AdditionalFilePaths.Add(filePath); } yield return(new PsaTraceInfo(trace, md)); } }
private LexiaTracesData GetAllTraceData() { LexiaTracesData result = new LexiaTracesData(); IEnumerable <FileInfo> files = GetAllTraceXmlFiles(); if (files.ToList().Count == 0) { return(null); } foreach (FileInfo file in files) { PeugeotTraceFactory factory = new PeugeotTraceFactory(file); LexiaTrace trace = factory.Generate(); trace.SourceFilePath = file.FullName; if (trace != null) { result.Traces.Add(trace); } } return(result); }