PageRenderTime 37ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/src/NUnit/UiException/Controls/IErrorListRenderer.cs

#
C# | 64 lines | 15 code | 6 blank | 43 comment | 0 complexity | c3efd83f8b91cc632b7a3630b1aeea99 MD5 | raw file
Possible License(s): GPL-2.0
  1. // ****************************************************************
  2. // This is free software licensed under the NUnit license. You may
  3. // obtain a copy of the license at http://nunit.org
  4. // ****************************************************************
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Text;
  8. using System.Drawing;
  9. namespace NUnit.UiException.Controls
  10. {
  11. /// <summary>
  12. /// The interface through which ErrorList interacts with a painter to paint itself.
  13. ///
  14. /// Direct implementation is:
  15. /// - DefaultErrorListRenderer
  16. /// </summary>
  17. public interface IErrorListRenderer
  18. {
  19. /// <summary>
  20. /// Draws the list on the given graphics.
  21. /// </summary>
  22. /// <param name="items">The item collection to paint on the graphics object</param>
  23. /// <param name="selected">The item to paint with selection feature</param>
  24. /// <param name="g">The target graphics object</param>
  25. /// <param name="viewport">The viewport location</param>
  26. void DrawToGraphics(ErrorItemCollection items, ErrorItem selected, Graphics g, Rectangle viewport);
  27. /// <summary>
  28. /// Draw the given item on the given graphics object.
  29. /// </summary>
  30. /// <param name="item">The item to be painted</param>
  31. /// <param name="index">The item's index</param>
  32. /// <param name="hovered">If true, this item can display hover feature</param>
  33. /// <param name="selected">If true, this item can display selection feature</param>
  34. /// <param name="g">The target graphics object</param>
  35. /// <param name="viewport">The current viewport</param>
  36. void DrawItem(ErrorItem item, int index, bool hovered, bool selected, Graphics g, Rectangle viewport);
  37. /// <summary>
  38. /// Given a collection of items and a graphics object, this method
  39. /// measures in pixels the size of the collection.
  40. /// </summary>
  41. /// <param name="items">The collection</param>
  42. /// <param name="g">The target graphics object</param>
  43. /// <returns>The size in pixels of the collection</returns>
  44. Size GetDocumentSize(ErrorItemCollection items, Graphics g);
  45. /// <summary>
  46. /// Gets the Item right under point.
  47. /// </summary>
  48. /// <param name="items">A collection of items</param>
  49. /// <param name="g">The target graphics object</param>
  50. /// <param name="point">Some client coordinate values</param>
  51. /// <returns>One item in the collection or null the location doesn't match any item</returns>
  52. ErrorItem ItemAt(ErrorItemCollection items, Graphics g, Point point);
  53. /// <summary>
  54. /// Gets and sets the font for this renderer
  55. /// </summary>
  56. Font Font { get; set; }
  57. }
  58. }