OperationRecordingCanvas.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 void Translate(Position vector) => Operations.Add(new CanvasTranslateOperation(vector));
  15. public void Rotate(float angle) => Operations.Add(new CanvasRotateOperation(angle));
  16. public void Scale(float scaleX, float scaleY) => Operations.Add(new CanvasScaleOperation(scaleX, scaleY));
  17. public void DrawFilledRectangle(Position vector, Size size, Color color) => Operations.Add(new CanvasDrawRectangleOperation(vector, size, color));
  18. public void DrawStrokeRectangle(Position vector, Size size, float strokeWidth, Color color) => throw new NotImplementedException();
  19. public void DrawParagraph(SkParagraph paragraph) => throw new NotImplementedException();
  20. public void DrawImage(SkImage image, Size size) => Operations.Add(new CanvasDrawImageOperation(Position.Zero, size));
  21. public void DrawPicture(SkPicture picture) => throw new NotImplementedException();
  22. public void DrawSvgPath(string path, Color color) => throw new NotImplementedException();
  23. public void DrawSvg(SkSvgImage svgImage, Size size) => throw new NotImplementedException();
  24. public void DrawOverflowArea(SkRect area) => throw new NotImplementedException();
  25. public void ClipOverflowArea(SkRect availableSpace, SkRect requiredSpace) => throw new NotImplementedException();
  26. public void ClipRectangle(SkRect clipArea) => throw new NotImplementedException();
  27. public void DrawHyperlink(string url, Size size) => throw new NotImplementedException();
  28. public void DrawSectionLink(string sectionName, Size size) => throw new NotImplementedException();
  29. public void DrawSection(string sectionName) => throw new NotImplementedException();
  30. }
  31. }