Repository navigation
Split DiffEngineTray into a portable core and a Windows head - #984
Merged
Merged
Conversation
The first step to a tray on macOS and Linux. DiffEngineTray.Core is everything that is not WinForms: Tracker, both inline hosts, PiperServer, the settings, DebugReport, IssueLauncher and Logging, with the Windows API helpers ProcessEx and FileLockKiller, which compile anywhere and run only on Windows until they have Unix paths. It builds on every platform. DiffEngineTray keeps Program, the menu, the forms, the hot keys, the icons and the Run key, and nothing on Windows changes. Two things crossed between the halves and now go through a seam. AlwaysKill was a static beside the locked file form, and is LockedFilesPolicy's in the core. IssueLauncher asked through a MessageBox; in the core it declines, having no toolkit to ask with, and the head hands it IssueQuestion's box first thing in Main. ProgramEntryPointTest found the tray's entry point through Tracker, which is the core's now, a library with none, so it asks the head's own assembly. The tray package gains DiffEngineTray.Core.dll and nothing else.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the first step to a DiffEngineTray on macOS and Linux (phase 2a of the plan): the tray splits into a portable core and a Windows head. Nothing on Windows changes.
DiffEngineTray.Core(net10.0, no WinForms, built on every platform) is everything that isn't WinForms:Tracker,OwnedInlineHost,RemoteInlineHostandPiperServer.DebugReport,IssueLauncher,Loggingand the payloads.ProcessExandFileLockKiller. They compile anywhere and run only on Windows until they get Unix paths, which is a later phase.The 35 files moved with
git mv, so their history follows.DiffEngineTraystays the Windows head:Program, the menu, the forms, the hot keys (KeyRegister, andKeyName, which parses into WinForms'Keys), the icons and the Run key.Two things crossed the line, and each now goes through a seam:
AlwaysKillwas a static beside the locked-file form. It is nowLockedFilesPolicyin the core, and the form stays in the head.IssueLauncherasked through aMessageBox. In the core it declines, since it has no toolkit to ask with, and the head hands itIssueQuestion's box first thing inMain.Tests:
ProgramEntryPointTestfound the tray's entry point throughTracker, which is now the core's: a library with no entry point. It now asks the head's own assembly.DiffEngineTray.Core.dlland nothing else.Still to come in phase 2: the core's tests move to a project that runs on every platform (2b), and the menu becomes a model snapshot tested as text (2c).