From 3e8895066920c5e873761e9d82e30c35016c37f6 Mon Sep 17 00:00:00 2001 From: TheXamlGuy Date: Sat, 6 Jan 2024 08:49:12 +0000 Subject: [PATCH] Rename projects to better structure it. The aim is to try and keep it not dependant on the type of UI framework it uses thus allowing us to switch to another UI framework if we need later... --- .../ContextualCommandBuilder.cs | 13 ------- .../Hyperbar.Desktop.Controls.csproj | 35 ------------------ .../PrimaryCommandBuilder.cs | 14 ------- .../PrimaryCommandView.xaml.cs | 8 ---- .../PrimaryCommandViewModel.cs | 17 --------- .../ContextualCommandWidgetBuilder.cs | 15 ++++++++ .../ContextualCommandWidgetConfiguration.cs | 5 +++ .../ContextualCommandWidgetView.xaml | 4 +- .../ContextualCommandWidgetView.xaml.cs | 8 ++-- .../ContextualCommandWidgetViewModel.cs | 6 +-- .../Hyperbar.Windows.Contextual.csproj | 6 ++- .../DesktopFlyout/DesktopFlyout.cs | 2 +- .../DesktopFlyout/DesktopFlyoutHost.cs | 8 ++-- .../DesktopFlyout/DesktopFlyoutPlacement.cs | 2 +- .../DesktopFlyout/DesktopFlyoutPresenter.cs | 2 +- .../DesktopFlyout/DesktopFlyoutPresenter.xaml | 2 +- .../DesktopFlyoutPresenterTemplateSettings.cs | 2 +- .../Hyperbar.Windows.Controls.csproj | 19 ++++++++++ .../Themes/Generic.xaml | 2 +- .../Hyperbar.Windows.Primary.csproj | 4 +- Hyperbar.Windows.Primary/IPrimaryCommand.cs | 7 ++++ .../KeyAcceleratorCommand.cs | 12 ++++++ .../PrimaryCommandConfiguration.cs | 7 ++++ .../PrimaryCommandWidgetBuilder.cs | 15 ++++++++ .../PrimaryCommandWidgetView.xaml | 2 +- .../PrimaryCommandWidgetView.xaml.cs | 8 ++++ .../PrimaryCommandWidgetViewModel.cs | 23 ++++++++++++ .../Extensions/HwndExtensions.cs | 2 +- .../Extensions/WindowExtensions.cs | 2 +- .../Extensions/WindowPlacement.cs | 2 +- .../Extensions/WindowStyle.cs | 2 +- .../Hyperbar.Windows.Win32.csproj | 0 .../Internals/PInvoke.cs | 0 .../KeyIntrop.cs | 2 +- .../NativeMethods.txt | 0 .../App.xaml | 4 +- .../App.xaml.cs | 30 ++++++--------- .../Assets/LockScreenLogo.scale-200.png | Bin .../Assets/SplashScreen.scale-200.png | Bin .../Assets/Square150x150Logo.scale-200.png | Bin .../Assets/Square44x44Logo.scale-200.png | Bin ...x44Logo.targetsize-24_altform-unplated.png | Bin .../Assets/StoreLogo.png | Bin .../Assets/Wide310x150Logo.scale-200.png | Bin .../Hyperbar.Windows.csproj | 9 +++-- .../Lifecycles/AppInitializer.cs | 4 +- .../IServiceCollectionExtensions.cs | 6 +-- .../Package.appxmanifest | 6 +-- .../Properties/launchSettings.json | 4 +- .../Templates/ITemplateGeneratorFactory.cs | 2 +- .../Templates/TemplateFactory.cs | 2 +- .../Templates/TemplateGeneratorControl.cs | 2 +- .../Templates/TemplateGeneratorFactory.cs | 4 +- .../Views/CommandView.xaml | 2 +- .../Views/CommandView.xaml.cs | 2 +- .../Views/CommandViewModel.cs | 7 +--- .../app.manifest | 2 +- Hyperbar.sln | 10 ++--- Hyperbar/Configuration/ConfigurationWriter.cs | 17 +++++---- .../Configuration/IConfigurationWriter.cs | 4 +- .../Configuration/IWritableConfiguration.cs | 2 +- .../Configuration/WritableConfiguration.cs | 2 +- .../IServiceCollectionExtensions.cs | 16 ++++---- ...mandContext.cs => CommandWidgetContext.cs} | 6 +-- ...andBuilder.cs => ICommandWidgetBuilder.cs} | 2 +- ...andContext.cs => ICommandWidgetContext.cs} | 2 +- ...iewModel.cs => ICommandWidgetViewModel.cs} | 2 +- 67 files changed, 211 insertions(+), 196 deletions(-) delete mode 100644 Hyperbar.Desktop.Contextual/ContextualCommandBuilder.cs delete mode 100644 Hyperbar.Desktop.Controls/Hyperbar.Desktop.Controls.csproj delete mode 100644 Hyperbar.Desktop.Primary/PrimaryCommandBuilder.cs delete mode 100644 Hyperbar.Desktop.Primary/PrimaryCommandView.xaml.cs delete mode 100644 Hyperbar.Desktop.Primary/PrimaryCommandViewModel.cs create mode 100644 Hyperbar.Windows.Contextual/ContextualCommandWidgetBuilder.cs create mode 100644 Hyperbar.Windows.Contextual/ContextualCommandWidgetConfiguration.cs rename Hyperbar.Desktop.Contextual/ContextualCommandView.xaml => Hyperbar.Windows.Contextual/ContextualCommandWidgetView.xaml (60%) rename Hyperbar.Desktop.Contextual/ContextualCommandView.xaml.cs => Hyperbar.Windows.Contextual/ContextualCommandWidgetView.xaml.cs (54%) rename Hyperbar.Desktop.Contextual/ContextualCommandViewModel.cs => Hyperbar.Windows.Contextual/ContextualCommandWidgetViewModel.cs (51%) rename Hyperbar.Desktop.Contextual/Hyperbar.Desktop.Contextual.csproj => Hyperbar.Windows.Contextual/Hyperbar.Windows.Contextual.csproj (76%) rename {Hyperbar.Desktop.Controls => Hyperbar.Windows.Controls}/DesktopFlyout/DesktopFlyout.cs (97%) rename {Hyperbar.Desktop.Controls => Hyperbar.Windows.Controls}/DesktopFlyout/DesktopFlyoutHost.cs (94%) rename {Hyperbar.Desktop.Controls => Hyperbar.Windows.Controls}/DesktopFlyout/DesktopFlyoutPlacement.cs (66%) rename {Hyperbar.Desktop.Controls => Hyperbar.Windows.Controls}/DesktopFlyout/DesktopFlyoutPresenter.cs (97%) rename {Hyperbar.Desktop.Controls => Hyperbar.Windows.Controls}/DesktopFlyout/DesktopFlyoutPresenter.xaml (99%) rename {Hyperbar.Desktop.Controls => Hyperbar.Windows.Controls}/DesktopFlyout/DesktopFlyoutPresenterTemplateSettings.cs (97%) create mode 100644 Hyperbar.Windows.Controls/Hyperbar.Windows.Controls.csproj rename {Hyperbar.Desktop.Controls => Hyperbar.Windows.Controls}/Themes/Generic.xaml (82%) rename Hyperbar.Desktop.Primary/Hyperbar.Desktop.Primary.csproj => Hyperbar.Windows.Primary/Hyperbar.Windows.Primary.csproj (89%) create mode 100644 Hyperbar.Windows.Primary/IPrimaryCommand.cs create mode 100644 Hyperbar.Windows.Primary/KeyAcceleratorCommand.cs create mode 100644 Hyperbar.Windows.Primary/PrimaryCommandConfiguration.cs create mode 100644 Hyperbar.Windows.Primary/PrimaryCommandWidgetBuilder.cs rename Hyperbar.Desktop.Primary/PrimaryCommandView.xaml => Hyperbar.Windows.Primary/PrimaryCommandWidgetView.xaml (79%) create mode 100644 Hyperbar.Windows.Primary/PrimaryCommandWidgetView.xaml.cs create mode 100644 Hyperbar.Windows.Primary/PrimaryCommandWidgetViewModel.cs rename {Hyperbar.Desktop.Win32 => Hyperbar.Windows.Win32}/Extensions/HwndExtensions.cs (99%) rename {Hyperbar.Desktop.Win32 => Hyperbar.Windows.Win32}/Extensions/WindowExtensions.cs (97%) rename {Hyperbar.Desktop.Win32 => Hyperbar.Windows.Win32}/Extensions/WindowPlacement.cs (66%) rename {Hyperbar.Desktop.Win32 => Hyperbar.Windows.Win32}/Extensions/WindowStyle.cs (95%) rename Hyperbar.Desktop.Win32/Hyperbar.Desktop.Win32.csproj => Hyperbar.Windows.Win32/Hyperbar.Windows.Win32.csproj (100%) rename {Hyperbar.Desktop.Win32 => Hyperbar.Windows.Win32}/Internals/PInvoke.cs (100%) rename {Hyperbar.Desktop.Win32 => Hyperbar.Windows.Win32}/KeyIntrop.cs (98%) rename {Hyperbar.Desktop.Win32 => Hyperbar.Windows.Win32}/NativeMethods.txt (100%) rename {Hyperbar.Desktop => Hyperbar.Windows}/App.xaml (88%) rename {Hyperbar.Desktop => Hyperbar.Windows}/App.xaml.cs (70%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Assets/LockScreenLogo.scale-200.png (100%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Assets/SplashScreen.scale-200.png (100%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Assets/Square150x150Logo.scale-200.png (100%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Assets/Square44x44Logo.scale-200.png (100%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Assets/Square44x44Logo.targetsize-24_altform-unplated.png (100%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Assets/StoreLogo.png (100%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Assets/Wide310x150Logo.scale-200.png (100%) rename Hyperbar.Desktop/Hyperbar.Desktop.csproj => Hyperbar.Windows/Hyperbar.Windows.csproj (83%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Lifecycles/AppInitializer.cs (89%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Lifecycles/IServiceCollectionExtensions.cs (82%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Package.appxmanifest (93%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Properties/launchSettings.json (57%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Templates/ITemplateGeneratorFactory.cs (82%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Templates/TemplateFactory.cs (97%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Templates/TemplateGeneratorControl.cs (95%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Templates/TemplateGeneratorFactory.cs (82%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Views/CommandView.xaml (91%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Views/CommandView.xaml.cs (90%) rename {Hyperbar.Desktop => Hyperbar.Windows}/Views/CommandViewModel.cs (69%) rename {Hyperbar.Desktop => Hyperbar.Windows}/app.manifest (93%) rename Hyperbar/Lifecycles/{CommandContext.cs => CommandWidgetContext.cs} (51%) rename Hyperbar/Lifecycles/{ICommandBuilder.cs => ICommandWidgetBuilder.cs} (77%) rename Hyperbar/Lifecycles/{ICommandContext.cs => ICommandWidgetContext.cs} (68%) rename Hyperbar/Lifecycles/{ICommandViewModel.cs => ICommandWidgetViewModel.cs} (50%) diff --git a/Hyperbar.Desktop.Contextual/ContextualCommandBuilder.cs b/Hyperbar.Desktop.Contextual/ContextualCommandBuilder.cs deleted file mode 100644 index 0d1c942..0000000 --- a/Hyperbar.Desktop.Contextual/ContextualCommandBuilder.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Hyperbar.Lifecycles; -using Microsoft.Extensions.DependencyInjection; - -namespace Hyperbar.Desktop.Contextual; - -public class ContextualCommandBuilder : - ICommandBuilder -{ - public void Create(IServiceCollection services) - { - services.AddCommandTemplate(); - } -} diff --git a/Hyperbar.Desktop.Controls/Hyperbar.Desktop.Controls.csproj b/Hyperbar.Desktop.Controls/Hyperbar.Desktop.Controls.csproj deleted file mode 100644 index 68bdadf..0000000 --- a/Hyperbar.Desktop.Controls/Hyperbar.Desktop.Controls.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - net8.0-windows10.0.19041.0 - 10.0.17763.0 - Hyperbar.Desktop.Controls - win10-x86;win10-x64;win10-arm64 - true - true - - - - - - - - - - - MSBuild:Compile - - - MSBuild:Compile - - - - - MSBuild:Compile - - - - - MSBuild:Compile - - - diff --git a/Hyperbar.Desktop.Primary/PrimaryCommandBuilder.cs b/Hyperbar.Desktop.Primary/PrimaryCommandBuilder.cs deleted file mode 100644 index af612f9..0000000 --- a/Hyperbar.Desktop.Primary/PrimaryCommandBuilder.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Hyperbar.Lifecycles; -using Microsoft.Extensions.DependencyInjection; - -namespace Hyperbar.Desktop.Primary; - -public class PrimaryCommandBuilder : - ICommandBuilder -{ - public void Create(IServiceCollection services) - { - services.AddCommandTemplate(); - } -} - diff --git a/Hyperbar.Desktop.Primary/PrimaryCommandView.xaml.cs b/Hyperbar.Desktop.Primary/PrimaryCommandView.xaml.cs deleted file mode 100644 index a4dbd6e..0000000 --- a/Hyperbar.Desktop.Primary/PrimaryCommandView.xaml.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Microsoft.UI.Xaml.Controls; - -namespace Hyperbar.Desktop.Primary; - -public sealed partial class PrimaryCommandView : Page -{ - public PrimaryCommandView() => InitializeComponent(); -} diff --git a/Hyperbar.Desktop.Primary/PrimaryCommandViewModel.cs b/Hyperbar.Desktop.Primary/PrimaryCommandViewModel.cs deleted file mode 100644 index b9263fb..0000000 --- a/Hyperbar.Desktop.Primary/PrimaryCommandViewModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Hyperbar.Lifecycles; -using Hyperbar.Templates; - -namespace Hyperbar.Desktop.Primary; - -public class PrimaryCommandConfiguration -{ - -} - -public class PrimaryCommandViewModel(ITemplateFactory templateFactory) : - ICommandViewModel, - ITemplatedViewModel -{ - public ITemplateFactory TemplateFactory { get; } = templateFactory; -} - diff --git a/Hyperbar.Windows.Contextual/ContextualCommandWidgetBuilder.cs b/Hyperbar.Windows.Contextual/ContextualCommandWidgetBuilder.cs new file mode 100644 index 0000000..03bdb78 --- /dev/null +++ b/Hyperbar.Windows.Contextual/ContextualCommandWidgetBuilder.cs @@ -0,0 +1,15 @@ +using Hyperbar.Lifecycles; +using Microsoft.Extensions.DependencyInjection; + +namespace Hyperbar.Windows.Contextual; + +public class ContextualCommandWidgetBuilder : + ICommandWidgetBuilder +{ + public void Create(IServiceCollection services) + { + services + .AddWritableConfiguration() + .AddCommandTemplate(); + } +} diff --git a/Hyperbar.Windows.Contextual/ContextualCommandWidgetConfiguration.cs b/Hyperbar.Windows.Contextual/ContextualCommandWidgetConfiguration.cs new file mode 100644 index 0000000..90f0ddf --- /dev/null +++ b/Hyperbar.Windows.Contextual/ContextualCommandWidgetConfiguration.cs @@ -0,0 +1,5 @@ +namespace Hyperbar.Windows.Contextual; + +public class ContextualCommandWidgetConfiguration +{ +} diff --git a/Hyperbar.Desktop.Contextual/ContextualCommandView.xaml b/Hyperbar.Windows.Contextual/ContextualCommandWidgetView.xaml similarity index 60% rename from Hyperbar.Desktop.Contextual/ContextualCommandView.xaml rename to Hyperbar.Windows.Contextual/ContextualCommandWidgetView.xaml index ad58c7c..191d57a 100644 --- a/Hyperbar.Desktop.Contextual/ContextualCommandView.xaml +++ b/Hyperbar.Windows.Contextual/ContextualCommandWidgetView.xaml @@ -1,9 +1,9 @@ -