public PdfPlotterTests() { PlotterFactory = new PdfPlotterFactory() { Workspace = Workspace // faking the import }; }
public async Task <Stream> PlotToStream(ViewPortViewModelBase viewModel, Drawing drawing, ViewPort viewPort) { var stream = new MemoryStream(); IPlotterFactory plotterFactory = viewModel switch { PdfPlotterViewModel _ => _pdfPlotterFactory, SvgPlotterViewModel _ => _svgPlotterFactory, _ => throw new System.Exception($"Unexpected view model: {viewModel?.GetType().Name}"), }; var plotter = plotterFactory.CreatePlotter(viewModel); await plotter.Plot(drawing, viewPort, stream, _workspace.FileSystemService.GetContentResolverRelativeToPath(drawing.Settings.FileName)); stream.Seek(0, SeekOrigin.Begin); return(stream); }
public PdfPlotterTests() { PlotterFactory = new PdfPlotterFactory(Workspace); }