Terminal.Gui icon indicating copy to clipboard operation
Terminal.Gui copied to clipboard

Refactor `MouseEvent` and `MouseEventEventArgs` to simplify

Open tig opened this issue 2 years ago • 2 comments

Similar in spirit, but somewhat less scope, than #2927

  • [x] New/OnMouseEvent now uses just MouseEvent.
  • [x] New/OnMouseClicked now uses just MouseEvent.
  • [ ] Beef-up/refactor mouse unit tests
  • [ ] Merge MouseEvent and MouseEventEventArgs into a single class.
  • [x] Better document/rename OfX/OfY
  • [x] Move mouse stuff out of Responder and into View so Responder can be nuked
  • [ ] Engineer something that removes the need for Responder.IsOverridden which breaks all rules of OO design.
  • [ ] Ensure all library code uses consistent naming/usage
  • [ ] Ensure all Scenario code uses best practices related to new design.
  • [ ] Ensure all API documentation is awesome
  • [x] Add a docs/mouse.md

tig avatar Dec 04 '23 00:12 tig

Partially fixed in #3372.

tig avatar Apr 04 '24 22:04 tig

BTW:

For adherence to the dotnet design guidelines for events, all EventArgs classes should end in "EventArgs" and should not be mixed use classes outside of events themselves (Key, for example, is used both ways - I have a stashed change somewhere that's probably way obsolete by now that fixed that).

Inheriting from EventArgs also used to be recommended, but is now just a soft suggestion.

Here's one of the best of the various documents about guidelines for events:

https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/how-to-publish-events-that-conform-to-net-framework-guidelines

dodexahedron avatar May 08 '24 21:05 dodexahedron