OperationRecordingCanvas.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using QuestPDF.Infrastructure;
  4. using QuestPDF.Skia;
  5. using QuestPDF.Skia.Text;
  6. using QuestPDF.UnitTests.TestEngine.Operations;
  7. namespace QuestPDF.UnitTests.TestEngine
  8. {
  9. internal sealed class OperationRecordingCanvas : ICanvas
  10. {
  11. public ICollection<OperationBase> Operations { get; } = new List<OperationBase>();
  12. public void Save() => throw new NotImplementedException();
  13. public void Restore() => throw new NotImplementedException();
  14. public CanvasMatrix GetCurrentMatrix() => throw new NotImplementedException();
  15. public void Translate(Position vector) => Operations.Add(new CanvasTranslateOperation(vector));
  16. public void Rotate(float angle) => Operations.Add(new CanvasRotateOperation(angle));
  17. public void Scale(float scaleX, float scaleY) => Operations.Add(new CanvasScaleOperation(scaleX, scaleY));
  18. public void DrawFilledRectangle(Position vector, Size size, Color color) => Operations.Add(new CanvasDrawRectangleOperation(vector, size, color));
  19. public void DrawStrokeRectangle(Position vector, Size size, float strokeWidth, Color color) => throw new NotImplementedException();
  20. public void DrawParagraph(SkParagraph paragraph) => throw new NotImplementedException();
  21. public void DrawImage(SkImage image, Size size) => Operations.Add(new CanvasDrawImageOperation(Position.Zero, size));
  22. public void DrawPicture(SkPicture picture) => throw new NotImplementedException();
  23. public void DrawSvgPath(string path, Color color) => throw new NotImplementedException();
  24. public void DrawSvg(SkSvgImage svgImage, Size size) => throw new NotImplementedException();
  25. public void DrawOverflowArea(SkRect area) => throw new NotImplementedException();
  26. public void ClipOverflowArea(SkRect availableSpace, SkRect requiredSpace) => throw new NotImplementedException();
  27. public void ClipRectangle(SkRect clipArea) => throw new NotImplementedException();
  28. public void DrawHyperlink(string url, Size size) => throw new NotImplementedException();
  29. public void DrawSectionLink(string sectionName, Size size) => throw new NotImplementedException();
  30. public void DrawSection(string sectionName) => throw new NotImplementedException();
  31. }
  32. }