DrawingRecorder.cs 728 B

123456789101112131415161718192021222324252627
  1. using System.Collections.ObjectModel;
  2. namespace QuestPDF.LayoutTests.TestEngine;
  3. internal class ElementDrawingEvent
  4. {
  5. public string ObserverId { get; set; }
  6. public int PageNumber { get; set; }
  7. public Position Position { get; set; }
  8. public Size Size { get; set; }
  9. public object? StateAfterDrawing { get; set; }
  10. }
  11. internal class DrawingRecorder
  12. {
  13. private List<ElementDrawingEvent> DrawingEvents { get; } = [];
  14. public void Record(ElementDrawingEvent elementDrawingEvent)
  15. {
  16. DrawingEvents.Add(elementDrawingEvent);
  17. }
  18. public IReadOnlyCollection<ElementDrawingEvent> GetDrawingEvents()
  19. {
  20. return new ReadOnlyCollection<ElementDrawingEvent>(DrawingEvents);
  21. }
  22. }