DrawingRecorder.cs 677 B

1234567891011121314151617181920212223242526
  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. }
  10. internal class DrawingRecorder
  11. {
  12. private List<ElementDrawingEvent> DrawingEvents { get; } = [];
  13. public void Record(ElementDrawingEvent elementDrawingEvent)
  14. {
  15. DrawingEvents.Add(elementDrawingEvent);
  16. }
  17. public IReadOnlyCollection<ElementDrawingEvent> GetDrawingEvents()
  18. {
  19. return new ReadOnlyCollection<ElementDrawingEvent>(DrawingEvents);
  20. }
  21. }