-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[Mouse Without Borders] - refactoring "Common" classes #35155
Comments
Make it so |
@mikeclayton isn't this #35156 or is there more |
@crutkas - There's more PRs to come - there's about a dozen "Common.*.cs" classes and we talked about moving cautiously and doing one file at a time so as not to break anything. I've been trying to get the Mouse Jump style work over the line in #35521 - once that's done I can spend a bit more time on Mouse Without Borders (I've got a second refactor lined up but I've not had time to go through the regression tests yet)... |
…mmon.Clipboard.cs, fixing unit tests - microsoft#35155
What's now? is #35858 related to this? |
I've been trying to put together a visual for this work so the benefits can be seen more easily. It's a long way from perfect, but here's what I've got so far... Original Code In short, the large blue box represents the "Common" class in Mouse Without Borders which is defined across 15 partial class files (the yellow boxes) - the "Private" members in red are visible across the entire class even though they're really private implementation details for isolated functionality in each partial class file. The work I'm doing is to move the code from each partial class file into a separate class (e.g. the partial class code in "Common.Receiver.cs" becomes a separate "Receiver" class in "Receiver.cs"). That way the Private members are truly private to the individual classes. The changes so far have resulted in this: Latest Code The blue boxes in the top right are the new Next Steps
|
[MouseWithoutBorders] - merge main, fix conflicts - microsoft#35155 Merge branch 'main' into dev/mikeclayton/mwb-common-refactor-machine-stuff # Conflicts: # src/modules/MouseWithoutBorders/App/Class/Common.DragDrop.cs # src/modules/MouseWithoutBorders/App/Class/Common.MachineStuff.cs # src/modules/MouseWithoutBorders/App/Core/Logger.cs # src/modules/MouseWithoutBorders/App/Core/Receiver.cs # src/modules/MouseWithoutBorders/MouseWithoutBorders.UnitTests/Core/Logger.PrivateDump.expected.txt # src/modules/MouseWithoutBorders/MouseWithoutBorders.UnitTests/Core/LoggerTests.cs
Description of the new feature / enhancement
As a precursor to #34126 (Integrate Mouse Jump with Mouse Without Borders) I've spoken with @crutkas and @ethanfangg about doing some mechanical refactoring to break the large "Common" class into multiple smaller classes as general maintenance / housekeeping work.
Each "Common.*.cs" partial file will be turned into a separate static class so as to reduce the scope of the private members inside them and make it easier / safer to perform other changes (e.g. integration with Mouse Jump) at a later date.
Changes to each "Common.*.cs" file will be submitted as a separate PR.
Scenario when this would be used?
No change in functionality - this is a refactoring / maintenance change designed to make some future work easier / safer to implement.
Supporting information
No response
The text was updated successfully, but these errors were encountered: