fix issue with memory streams not being handled correctly through interfaces, using out variables.
implement full export handling now with the finalised interface.
This commit is contained in:
parent
675479d2cf
commit
ed345150b9
@ -19,11 +19,22 @@ namespace RaceLapTimer.Extensions.FileExport
|
||||
return _exporters;
|
||||
}
|
||||
|
||||
public Stream Export(string fileContent, string baseUrl)
|
||||
public void Export(string exportType, string fileContent, string baseUrl, out Stream exportStream)
|
||||
{
|
||||
if (_exporters.Any())
|
||||
return _exporters.First().Export(fileContent, baseUrl);
|
||||
return new MemoryStream();
|
||||
{
|
||||
var exporter = _exporters.FirstOrDefault(x => x.GetDetails().Type == exportType);
|
||||
if (exporter != null)
|
||||
{
|
||||
exporter.Export(fileContent, baseUrl, out exportStream);
|
||||
}
|
||||
else
|
||||
{
|
||||
exportStream = new MemoryStream();
|
||||
}
|
||||
}
|
||||
else
|
||||
exportStream = new MemoryStream();
|
||||
}
|
||||
|
||||
public List<ExportProviderDetails> GetExporterDetails()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user