TableSelection.cs 898 B

123456789101112131415161718192021222324252627282930313233343536
  1. namespace Terminal.Gui;
  2. /// <summary>
  3. /// Describes a selected region of the table
  4. /// </summary>
  5. public class TableSelection {
  6. /// <summary>
  7. /// Corner of the <see cref="Rect"/> where selection began
  8. /// </summary>
  9. /// <value></value>
  10. public Point Origin { get; set; }
  11. /// <summary>
  12. /// Area selected
  13. /// </summary>
  14. /// <value></value>
  15. public Rect Rect { get; set; }
  16. /// <summary>
  17. /// True if the selection was made through <see cref="Command.ToggleChecked"/>
  18. /// and therefore should persist even through keyboard navigation.
  19. /// </summary>
  20. public bool IsToggled { get; set; }
  21. /// <summary>
  22. /// Creates a new selected area starting at the origin corner and covering the provided rectangular area
  23. /// </summary>
  24. /// <param name="origin"></param>
  25. /// <param name="rect"></param>
  26. public TableSelection (Point origin, Rect rect)
  27. {
  28. Origin = origin;
  29. Rect = rect;
  30. }
  31. }