Skip to content

Conversation

@michelebastione
Copy link
Contributor

@michelebastione michelebastione commented Mar 15, 2025

Added cancellation token to async methods missing it

  • Fixes cancellationToken not working #737
  • Fixed methods InsertAsync and SaveAsAsync not forwarding the cancellation token to the callees, preventing the actual cancellation of the processe from the outside
  • Added cancellation token support to a number of private and internal async methods, and increased the frequency of the checks for whether they've been cancelled in order to reach the termination quicker
  • Improved on PR Fixed issue #735 #736 by adding same missing configuration parameter to method MiniExcel.InsertAsync.

Enhanced methods Insert, SaveAs and relative async versions

  • Resolves return the number of rows writen on a Insert or SaveAs operation using a IdataReader #733
  • The methods Insert / InsertAsync now return the number of rows inserted into the worksheet, while SaveAs / SaveAsAsync return an int array representing the rows inserted into each worksheet
  • Added asserts in tests for checking the aferomentioned return values
  • General code and tests cleanup: denesting branches with early returns and null conditional operators, renaming variables to be more consistent, turning methods that don't change state of the object into static functions, simplified type and collection initializations, added pragmas to disable warnings for tests that check deprecated methods, and so on.

Added active tab functionality

  • Resolves How do I get the active tab in MiniExcel #732
  • Added property Active in classes SheetInfo and SheetRecord to indicate wheter the worksheet referenced represents the active tab
  • Added 3 new tests and samples for checking said functionality

- The methods Insert / InsertAsync now return the number of rows inserted into the worksheet, while SaveAs / SaveAsAsync return an int array representing the rows inserted into each worksheet
- Added asserts in tests to that check for aferomentioned return values to be correct, plus a little bit of tiding said tests
- Minor code cleanup (denesting branches, renaming variables, turning methods that don't change state of the object into static functions...)
- Fixed methods InsertAsync and SaveAsAsync not forwarding the cancellation token to the callees, preventing the actual cancellation of the processes from the outside
- Added cancellation token support to a number of private and internal async methods, and increased the frequency of cancellation tokens checking whether they've been cancelled, in order to make the reach termination of the process as close as to when it's requested as possible
Some more renaming / cleaning up, especially in the tests
Adde property Active in classes SheetInfo and SheetRecord to indicate wheter the worksheet referenced represents the active tab
@michelebastione
Copy link
Contributor Author

I apologize for the massive pull request, I hope it's not too much of an inconvenience to review.

@shps951023 shps951023 merged commit 6105d3d into mini-software:master Mar 16, 2025
3 checks passed
@shps951023
Copy link
Member

👍👍👍 Reviewed and merged, and I will release new version tomorrow night

@izanhzh izanhzh removed their request for review March 17, 2025 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants