Description
src/Servy/App.xaml.cs (~290 lines) and src/Servy.Manager/App.xaml.cs (~285 lines) contain near-identical initialization logic:
OnStartup(): Identical rendering tier detection, software rendering fallback
OnExit(): Identical SecureData disposal
InitializeApp(): Both do identical unhandled exception handlers, splash screen parsing, ConfigurationBuilder setup, AppFoldersHelper.EnsureFolders, DatabaseInitializer, ProtectedKeyProvider + SecureData, ResourceHelper.CopyEmbeddedResource calls
Only the log filename and appsettings filename differ.
Estimated redundant lines: ~400
Suggested fix
Extract an AppBootstrapper class in a shared project that handles common initialization. Each App.xaml.cs passes project-specific values (log filename, appsettings filename, MainWindow factory).
Description
src/Servy/App.xaml.cs(~290 lines) andsrc/Servy.Manager/App.xaml.cs(~285 lines) contain near-identical initialization logic:OnStartup(): Identical rendering tier detection, software rendering fallbackOnExit(): Identical SecureData disposalInitializeApp(): Both do identical unhandled exception handlers, splash screen parsing, ConfigurationBuilder setup, AppFoldersHelper.EnsureFolders, DatabaseInitializer, ProtectedKeyProvider + SecureData, ResourceHelper.CopyEmbeddedResource callsOnly the log filename and appsettings filename differ.
Estimated redundant lines: ~400
Suggested fix
Extract an
AppBootstrapperclass in a shared project that handles common initialization. EachApp.xaml.cspasses project-specific values (log filename, appsettings filename, MainWindow factory).