Skip to content

Fixes #4023 - Changes CommandEventArgs to be based on HandledEventArgs instead of CancelEventArgs #4054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
May 9, 2025

Conversation

tig
Copy link
Collaborator

@tig tig commented Apr 25, 2025

Fixes

Pull Request checklist:

  • I've named my PR in the form of "Fixes #issue. Terse description."
  • My code follows the style guidelines of Terminal.Gui - if you use Visual Studio, hit CTRL-K-D to automatically reformat your files before committing.
  • My code follows the Terminal.Gui library design guidelines
  • I ran dotnet test before commit
  • I have made corresponding changes to the API documentation (using /// style comments)
  • My changes generate no new warnings
  • I have checked my code and corrected any poor grammar or misspellings
  • I conducted basic QA to assure all features are working

tig added 24 commits March 21, 2025 08:22
@tig tig requested a review from Copilot April 25, 2025 17:12
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issue #4023 by replacing the use of CancelEventArgs with HandledEventArgs in various command event handlers across the Terminal.Gui examples. The key changes include:

  • Updating assignments from e.Cancel to e.Handled for consistent event handling.
  • Revising inline comments to reflect the new property.
  • Modifying the ReactiveExample command event argument types (with one potential inconsistency noted).

Reviewed Changes

Copilot reviewed 51 out of 51 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Examples/UICatalog/Scenarios/SimpleDialog.cs Replaced e.Cancel with e.Handled in dialog acceptance.
Examples/UICatalog/Scenarios/Shortcuts.cs Updated event handler assignments from Cancel to Handled.
Examples/UICatalog/Scenarios/MessageBoxes.cs Changed event assignment from e.Cancel to e.Handled.
Examples/UICatalog/Scenarios/Menus.cs Systematic change from e.Cancel to e.Handled in menu actions.
Examples/UICatalog/Scenarios/LineDrawing.cs Replaced e.Cancel with e.Handled in color prompting events.
Examples/UICatalog/Scenarios/Generic.cs Adjusted comment and event property from e.Cancel to e.Handled.
Examples/UICatalog/Scenarios/FileDialogExamples.cs Changed file dialog event handling from Cancel to Handled.
Examples/UICatalog/Scenarios/Editors/PosEditor.cs Updated event property from e.Cancel to e.Handled in editor init.
Examples/UICatalog/Scenarios/Editors/DimEditor.cs Replaced e.Cancel with e.Handled in dimension editor events.
Examples/UICatalog/Scenarios/Dialogs.cs Multiple updates of e.Cancel to e.Handled in dialog event handlers.
Examples/UICatalog/Scenarios/CharacterMap/CharacterMap.cs Replaced e.Cancel with e.Handled when handling the ENTER key.
Examples/UICatalog/Scenarios/Buttons.cs Numerous updates replacing e.Cancel with e.Handled in button events.
Examples/UICatalog/Scenarios/Bars.cs Modified event handling for menu shortcuts and status bar actions.
Examples/UICatalog/Scenarios/AllViewsTester.cs Changed event handling property from Cancel to Handled.
Examples/UICatalog/Scenarios/Adornments.cs Updated window close event to use e.Handled instead of e.Cancel.
Examples/SelfContained/Program.cs Revised comment and event property from e.Cancel to e.Handled.
Examples/NativeAot/Program.cs Changed event handling from e.Cancel to e.Handled for login error events.
Examples/Example/Example.cs Updated acceptance logic replacing e.Cancel with e.Handled.
Examples/CommunityToolkitExample/LoginView.cs Revised event handling to use e.Handled instead of e.Cancel.
Examples/ReactiveExample/LoginViewModel.cs Changed ReactiveCommand event args type from HandledEventArgs to CancelEventArgs (potential inconsistency).

@tig
Copy link
Collaborator Author

tig commented Apr 25, 2025

Modifying the ReactiveExample command event argument types (with one potential inconsistency noted).

I had to do this because I couldn't get the reactive sample to build otherwise.

@tig tig requested a review from BDisp April 25, 2025 17:23
@tig tig merged commit e0de73a into gui-cs:v2_develop May 9, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change CommandEventArgs to be based on HandledEventArgs instead of CancelEventArgs
2 participants