From e1c7846e45d6a1bf758af31c0290f5cc834b6edb Mon Sep 17 00:00:00 2001 From: TheXamlGuy Date: Sat, 6 Jan 2024 14:34:25 +0000 Subject: [PATCH] Codemaid --- .../ContextualWidgetBuilder.cs | 5 +- .../ContextualWidgetConfiguration.cs | 4 +- .../ContextualWidgetViewModel.cs | 2 +- .../DesktopFlyout/DesktopFlyout.cs | 2 +- .../DesktopFlyout/DesktopFlyoutHost.cs | 16 +++-- .../DesktopFlyout/DesktopFlyoutPlacement.cs | 2 +- .../DesktopFlyout/DesktopFlyoutPresenter.cs | 2 +- .../DesktopFlyout/DesktopFlyoutPresenter.xaml | 2 +- .../DesktopFlyoutPresenterTemplateSettings.cs | 3 +- Hyperbar.Windows.Controls/Themes/Generic.xaml | 2 +- Hyperbar.Windows.Primary/IPrimaryCommand.cs | 4 +- .../KeyAcceleratorCommand.cs | 5 +- .../PrimaryWidgetBuilder.cs | 4 +- .../PrimaryWidgetConfiguration.cs | 6 +- .../PrimaryWidgetViewModel.cs | 9 ++- .../Extensions/HwndExtensions.cs | 9 ++- .../Extensions/WindowExtensions.cs | 3 +- .../Extensions/WindowStyle.cs | 2 +- Hyperbar.Windows.Win32/Internals/PInvoke.cs | 58 ++++++++++++++++++- Hyperbar.Windows.Win32/KeyIntrop.cs | 8 +-- Hyperbar.Windows/App.xaml | 2 +- Hyperbar.Windows/App.xaml.cs | 17 +++--- Hyperbar.Windows/Lifecycles/AppInitializer.cs | 4 +- .../IServiceCollectionExtensions.cs | 3 +- .../Templates/ITemplateGeneratorFactory.cs | 1 - .../Templates/TemplateGeneratorControl.cs | 4 +- .../Templates/TemplateGeneratorFactory.cs | 6 +- Hyperbar.Windows/Views/CommandView.xaml | 2 +- Hyperbar.Windows/Views/CommandView.xaml.cs | 4 +- Hyperbar.Windows/Views/CommandViewModel.cs | 4 +- Hyperbar.Windows/Views/WidgetButtonView.xaml | 2 +- .../Views/WidgetButtonView.xaml.cs | 4 +- Hyperbar.Windows/Views/WidgetView.xaml | 2 +- Hyperbar.Windows/Views/WidgetView.xaml.cs | 2 +- Hyperbar/Configuration/ConfigurationWriter.cs | 4 +- .../Configuration/IConfigurationWriter.cs | 2 +- .../Configuration/IWritableConfiguration.cs | 8 +-- .../Configuration/WritableConfiguration.cs | 10 ++-- .../IServiceCollectionExtensions.cs | 42 +++++++------- Hyperbar/Factories/IServiceFactory.cs | 2 +- Hyperbar/Factories/ServiceFactory.cs | 6 +- Hyperbar/Lifecycles/AppService.cs | 2 +- Hyperbar/Lifecycles/IInitializer.cs | 1 - Hyperbar/Lifecycles/IWidgetBuilder.cs | 2 +- Hyperbar/Lifecycles/IWidgetContext.cs | 2 +- .../Mediators/CommandClassHandlerWrapper.cs | 8 +-- Hyperbar/Mediators/ICommand.cs | 3 +- Hyperbar/Mediators/ICommandHandler.cs | 23 ++++++-- Hyperbar/Mediators/IMediator.cs | 13 ++--- Hyperbar/Mediators/IMessage.cs | 3 +- Hyperbar/Mediators/INotification.cs | 3 +- Hyperbar/Mediators/INotificationHandler.cs | 9 ++- Hyperbar/Mediators/IPipelineBehavior.cs | 9 ++- Hyperbar/Mediators/IQuery.cs | 2 +- Hyperbar/Mediators/IQueryHandler.cs | 6 +- Hyperbar/Mediators/IRequest.cs | 2 +- Hyperbar/Mediators/IRequestHandler.cs | 11 ++-- Hyperbar/Mediators/Mediator.cs | 18 +++--- Hyperbar/Mediators/MessageHandlerDelegate.cs | 2 +- .../Mediators/QueryClassHandlerWrapper.cs | 6 +- .../Mediators/RequestClassHandlerWrapper.cs | 8 +-- Hyperbar/Mediators/Unit.cs | 9 ++- .../Templates/ContentTemplateDescriptor.cs | 3 +- .../Templates/IContentTemplateDescriptor.cs | 3 +- Hyperbar/Templates/ITemplateFactory.cs | 2 +- Hyperbar/Templates/ITemplatedViewModel.cs | 2 +- Hyperbar/Views/IWidgetComponentViewModel.cs | 1 - Hyperbar/Views/IWidgetView.cs | 3 +- Hyperbar/Views/IWidgetViewModel.cs | 3 +- .../Views/ObservableCollectionViewModel.cs | 5 +- Hyperbar/Views/WidgetButtonViewModel.cs | 2 +- .../Views/WidgetComponentViewModelBase.cs | 2 +- Hyperbar/Views/WidgetViewModelBase.cs | 2 +- 73 files changed, 251 insertions(+), 198 deletions(-) diff --git a/Hyperbar.Windows.Contextual/ContextualWidgetBuilder.cs b/Hyperbar.Windows.Contextual/ContextualWidgetBuilder.cs index 09b09b0..0ee5d27 100644 --- a/Hyperbar.Windows.Contextual/ContextualWidgetBuilder.cs +++ b/Hyperbar.Windows.Contextual/ContextualWidgetBuilder.cs @@ -1,11 +1,12 @@ +using Hyperbar.Extensions; using Microsoft.Extensions.DependencyInjection; namespace Hyperbar.Widget.Contextual; -public class ContextualWidgetBuilder : +public class ContextualWidgetBuilder : IWidgetBuilder { public void Create(IServiceCollection services) => services .AddConfiguration() .AddWidgetTemplate(); -} +} \ No newline at end of file diff --git a/Hyperbar.Windows.Contextual/ContextualWidgetConfiguration.cs b/Hyperbar.Windows.Contextual/ContextualWidgetConfiguration.cs index 5187599..af29871 100644 --- a/Hyperbar.Windows.Contextual/ContextualWidgetConfiguration.cs +++ b/Hyperbar.Windows.Contextual/ContextualWidgetConfiguration.cs @@ -1,5 +1,5 @@ namespace Hyperbar.Widget.Contextual; public class ContextualWidgetConfiguration -{ -} +{ +} \ No newline at end of file diff --git a/Hyperbar.Windows.Contextual/ContextualWidgetViewModel.cs b/Hyperbar.Windows.Contextual/ContextualWidgetViewModel.cs index 170fe8d..31e0af0 100644 --- a/Hyperbar.Windows.Contextual/ContextualWidgetViewModel.cs +++ b/Hyperbar.Windows.Contextual/ContextualWidgetViewModel.cs @@ -3,7 +3,7 @@ public class ContextualWidgetViewModel : WidgetViewModelBase { - public ContextualWidgetViewModel(ITemplateFactory templateFactory, + public ContextualWidgetViewModel(ITemplateFactory templateFactory, IServiceFactory serviceFactory) : base(templateFactory, serviceFactory) { Add(); diff --git a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyout.cs b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyout.cs index 0b2285a..bf369e3 100644 --- a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyout.cs +++ b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyout.cs @@ -53,4 +53,4 @@ public class DesktopFlyout : private void OnPlacementPropertyChanged() => UpdatePlacement(); private void UpdatePlacement() => host.UpdatePlacement(Placement); -} +} \ No newline at end of file diff --git a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutHost.cs b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutHost.cs index 505e2de..bed1762 100644 --- a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutHost.cs +++ b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutHost.cs @@ -1,7 +1,7 @@ -using Microsoft.UI.Xaml; -using Hyperbar.Windows.Win32; -using Microsoft.UI.Xaml.Controls.Primitives; +using Hyperbar.Windows.Win32; +using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; namespace Hyperbar.Windows.Controls; @@ -20,7 +20,7 @@ internal class DesktopFlyoutHost : Window presenter.SizeChanged += OnChildSizeChanged; Content = root; - + this.SetOpacity(0); this.SetStyle(WindowStyle.SysMenu | WindowStyle.Visible); this.SetTopMost(true); @@ -37,7 +37,7 @@ internal class DesktopFlyoutHost : Window return; } - // presenter.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); + // presenter.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); double height = presenter.DesiredSize.Height; double width = presenter.DesiredSize.Width; @@ -47,15 +47,19 @@ internal class DesktopFlyoutHost : Window case DesktopFlyoutPlacement.Left: this.Snap(WindowPlacement.Left, 0, 0); break; + case DesktopFlyoutPlacement.Top: this.Snap(WindowPlacement.Top, width, height); break; + case DesktopFlyoutPlacement.Right: this.Snap(WindowPlacement.Right, 0, 0); break; + case DesktopFlyoutPlacement.Bottom: this.Snap(WindowPlacement.Bottom, width, height); break; + default: break; } @@ -85,4 +89,4 @@ internal class DesktopFlyoutHost : Window UpdatePlacement(placement); } -} +} \ No newline at end of file diff --git a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPlacement.cs b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPlacement.cs index 5404818..8095a23 100644 --- a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPlacement.cs +++ b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPlacement.cs @@ -6,4 +6,4 @@ public enum DesktopFlyoutPlacement Top, Right, Bottom -} +} \ No newline at end of file diff --git a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.cs b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.cs index b2cf70a..4dd59b0 100644 --- a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.cs +++ b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.cs @@ -37,4 +37,4 @@ public class DesktopFlyoutPresenter : } internal void UpdatePlacementState(DesktopFlyoutPlacement placement) => VisualStateManager.GoToState(this, $"{placement}Placement", true); -} +} \ No newline at end of file diff --git a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.xaml b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.xaml index b799301..40676c4 100644 --- a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.xaml +++ b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenter.xaml @@ -83,4 +83,4 @@ - + \ No newline at end of file diff --git a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenterTemplateSettings.cs b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenterTemplateSettings.cs index 4ce8906..bebd207 100644 --- a/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenterTemplateSettings.cs +++ b/Hyperbar.Windows.Controls/DesktopFlyout/DesktopFlyoutPresenterTemplateSettings.cs @@ -29,6 +29,7 @@ public class DesktopFlyoutPresenterTemplateSettings : DependencyObject get => (double)GetValue(HeightProperty); set => SetValue(HeightProperty, value); } + public double NegativeHeight { get => (double)GetValue(NegativeHeightProperty); @@ -46,4 +47,4 @@ public class DesktopFlyoutPresenterTemplateSettings : DependencyObject get => (double)GetValue(WidthProperty); set => SetValue(WidthProperty, value); } -} +} \ No newline at end of file diff --git a/Hyperbar.Windows.Controls/Themes/Generic.xaml b/Hyperbar.Windows.Controls/Themes/Generic.xaml index f1cbb84..bea35d6 100644 --- a/Hyperbar.Windows.Controls/Themes/Generic.xaml +++ b/Hyperbar.Windows.Controls/Themes/Generic.xaml @@ -3,4 +3,4 @@ - + \ No newline at end of file diff --git a/Hyperbar.Windows.Primary/IPrimaryCommand.cs b/Hyperbar.Windows.Primary/IPrimaryCommand.cs index c9bd96f..245bc25 100644 --- a/Hyperbar.Windows.Primary/IPrimaryCommand.cs +++ b/Hyperbar.Windows.Primary/IPrimaryCommand.cs @@ -2,6 +2,4 @@ public interface IPrimaryCommand { - -} - +} \ No newline at end of file diff --git a/Hyperbar.Windows.Primary/KeyAcceleratorCommand.cs b/Hyperbar.Windows.Primary/KeyAcceleratorCommand.cs index de0699a..d8bb87e 100644 --- a/Hyperbar.Windows.Primary/KeyAcceleratorCommand.cs +++ b/Hyperbar.Windows.Primary/KeyAcceleratorCommand.cs @@ -1,6 +1,6 @@ namespace Hyperbar.Windows.Primary; -public class KeyAcceleratorCommand : +public class KeyAcceleratorCommand : IPrimaryCommand { public string? Icon { get; set; } @@ -8,5 +8,4 @@ public class KeyAcceleratorCommand : public string? Key { get; set; } public string[]? Modifiers { get; set; } -} - +} \ No newline at end of file diff --git a/Hyperbar.Windows.Primary/PrimaryWidgetBuilder.cs b/Hyperbar.Windows.Primary/PrimaryWidgetBuilder.cs index d25e082..9cdae6c 100644 --- a/Hyperbar.Windows.Primary/PrimaryWidgetBuilder.cs +++ b/Hyperbar.Windows.Primary/PrimaryWidgetBuilder.cs @@ -1,3 +1,4 @@ +using Hyperbar.Extensions; using Microsoft.Extensions.DependencyInjection; namespace Hyperbar.Windows.Primary; @@ -7,5 +8,4 @@ public class PrimaryWidgetBuilder : { public void Create(IServiceCollection services) => services.AddConfiguration() .AddWidgetTemplate(); -} - +} \ No newline at end of file diff --git a/Hyperbar.Windows.Primary/PrimaryWidgetConfiguration.cs b/Hyperbar.Windows.Primary/PrimaryWidgetConfiguration.cs index 38b1b46..16b454c 100644 --- a/Hyperbar.Windows.Primary/PrimaryWidgetConfiguration.cs +++ b/Hyperbar.Windows.Primary/PrimaryWidgetConfiguration.cs @@ -1,8 +1,6 @@ namespace Hyperbar.Windows.Primary; -public class PrimaryWidgetConfiguration : +public class PrimaryWidgetConfiguration : List { - -} - +} \ No newline at end of file diff --git a/Hyperbar.Windows.Primary/PrimaryWidgetViewModel.cs b/Hyperbar.Windows.Primary/PrimaryWidgetViewModel.cs index f508571..76a4a0c 100644 --- a/Hyperbar.Windows.Primary/PrimaryWidgetViewModel.cs +++ b/Hyperbar.Windows.Primary/PrimaryWidgetViewModel.cs @@ -3,17 +3,16 @@ public class PrimaryWidgetViewModel : WidgetViewModelBase { - public PrimaryWidgetViewModel(ITemplateFactory templateFactory, + public PrimaryWidgetViewModel(ITemplateFactory templateFactory, IServiceFactory serviceFactory) : base(templateFactory, serviceFactory) { ; - Add("test 1", new Action(() => { - + Add("test 1", new Action(() => + { })); Add("test 2", new Action(() => { })); Add("test 4", new Action(() => { })); Add("test 5", new Action(() => { })); } -} - +} \ No newline at end of file diff --git a/Hyperbar.Windows.Win32/Extensions/HwndExtensions.cs b/Hyperbar.Windows.Win32/Extensions/HwndExtensions.cs index b905883..7a9aa0e 100644 --- a/Hyperbar.Windows.Win32/Extensions/HwndExtensions.cs +++ b/Hyperbar.Windows.Win32/Extensions/HwndExtensions.cs @@ -1,8 +1,8 @@ using System; +using System.Runtime.InteropServices; using Windows.Win32; using Windows.Win32.Foundation; using Windows.Win32.Graphics.Gdi; -using System.Runtime.InteropServices; using Windows.Win32.UI.WindowsAndMessaging; namespace Hyperbar.Windows.Win32; @@ -15,7 +15,7 @@ public static class HwndExtensions WS_EX_LAYERED = 0x80000 } - public static void SetWindowOpacity(this IntPtr hWnd, + public static void SetWindowOpacity(this IntPtr hWnd, byte value) { HWND hWND = new(hWnd); @@ -72,14 +72,17 @@ public static class HwndExtensions left = 0; top = (info.rcWork.bottom + info.rcWork.top) / 2 - actualHeight / 2; break; + case WindowPlacement.Top: left = (info.rcWork.left + info.rcWork.right) / 2 - actualWidth / 2; top = 0; break; + case WindowPlacement.Right: left = info.rcWork.left + info.rcWork.right - actualWidth; top = (info.rcWork.bottom + info.rcWork.top) / 2 - actualHeight / 2; break; + case WindowPlacement.Bottom: left = (info.rcWork.left + info.rcWork.right) / 2 - actualWidth / 2; top = info.rcWork.bottom + info.rcWork.top - actualHeight; @@ -88,4 +91,4 @@ public static class HwndExtensions PInvoke.SetWindowPos(new HWND(hwnd), new HWND(), left, top, actualWidth, actualHeight, 0); } -} +} \ No newline at end of file diff --git a/Hyperbar.Windows.Win32/Extensions/WindowExtensions.cs b/Hyperbar.Windows.Win32/Extensions/WindowExtensions.cs index 4dd9222..8c5d36a 100644 --- a/Hyperbar.Windows.Win32/Extensions/WindowExtensions.cs +++ b/Hyperbar.Windows.Win32/Extensions/WindowExtensions.cs @@ -1,7 +1,6 @@ using Microsoft.UI.Windowing; using Microsoft.UI.Xaml; using System; -using Windows.UI.Popups; using WinRT.Interop; namespace Hyperbar.Windows.Win32; @@ -34,4 +33,4 @@ public static class WindowExtensions WindowPlacement placement, double? width = null, double? height = null) => window.GetHandle().SnapWindow(placement, width, height); -} +} \ No newline at end of file diff --git a/Hyperbar.Windows.Win32/Extensions/WindowStyle.cs b/Hyperbar.Windows.Win32/Extensions/WindowStyle.cs index 3889390..ecc878f 100644 --- a/Hyperbar.Windows.Win32/Extensions/WindowStyle.cs +++ b/Hyperbar.Windows.Win32/Extensions/WindowStyle.cs @@ -30,4 +30,4 @@ public enum WindowStyle TiledWindow = 0xCF0000, Visible = 0x10000000, VScroll = 0x200000 -} +} \ No newline at end of file diff --git a/Hyperbar.Windows.Win32/Internals/PInvoke.cs b/Hyperbar.Windows.Win32/Internals/PInvoke.cs index 7758bb9..ddf9ef7 100644 --- a/Hyperbar.Windows.Win32/Internals/PInvoke.cs +++ b/Hyperbar.Windows.Win32/Internals/PInvoke.cs @@ -19,6 +19,7 @@ namespace Windows.Win32 return __result; } } + /// internal static unsafe nuint SHAppBarMessage(uint dwMessage, ref APPBARDATA64 pData) { @@ -74,6 +75,7 @@ namespace Windows.Win32 return __result; } } + /// internal static unsafe bool Shell_NotifyIcon(uint dwMessage, in NOTIFYICONDATAW64 lpData) { @@ -134,24 +136,28 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal uint cbSize; + /// /// Type: HWND /// The handle to the appbar window. Not all messages use this member. See the individual message page to see if you need to provide an hWind value. /// Read more on docs.microsoft.com. /// internal HWND hWnd; + /// /// Type: UINT /// An application-defined message identifier. The application uses the specified identifier for notification messages that it sends to the appbar identified by the hWnd member. This member is used when sending the ABM_NEW message. /// Read more on docs.microsoft.com. /// internal uint uCallbackMessage; + /// /// Type: UINT A value that specifies an edge of the screen. This member is used when sending one of these messages: /// This doc was truncated. /// Read more on docs.microsoft.com. /// internal uint uEdge; + /// /// Type: RECT A RECT structure whose use varies depending on the message: /// @@ -159,6 +165,7 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal RECT rc; + /// /// Type: LPARAM A message-dependent value. This member is used with these messages: /// This doc was truncated. @@ -179,24 +186,28 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal uint cbSize; + /// /// Type: HWND /// The handle to the appbar window. Not all messages use this member. See the individual message page to see if you need to provide an hWind value. /// Read more on docs.microsoft.com. /// internal HWND hWnd; + /// /// Type: UINT /// An application-defined message identifier. The application uses the specified identifier for notification messages that it sends to the appbar identified by the hWnd member. This member is used when sending the ABM_NEW message. /// Read more on docs.microsoft.com. /// internal uint uCallbackMessage; + /// /// Type: UINT A value that specifies an edge of the screen. This member is used when sending one of these messages: /// This doc was truncated. /// Read more on docs.microsoft.com. /// internal uint uEdge; + /// /// Type: RECT A RECT structure whose use varies depending on the message: /// @@ -204,6 +215,7 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal RECT rc; + /// /// Type: LPARAM A message-dependent value. This member is used with these messages: /// This doc was truncated. @@ -211,16 +223,20 @@ namespace Windows.Win32 /// internal LPARAM lParam; } + internal struct __ushort_128 { internal ushort _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127; + /// Always 128. internal int Length => 128; + /// /// Gets a ref to an individual element of the inline array. /// ⚠ Important ⚠: When this struct is on the stack, do not let the returned reference outlive the stack frame that defines it. /// internal ref ushort this[int index] => ref AsSpan()[index]; + /// /// Gets this inline array as a span. /// @@ -249,20 +265,24 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal uint cbSize; + /// /// Type: HWND /// A handle to the window that receives notifications associated with an icon in the notification area. /// Read more on docs.microsoft.com. /// internal HWND hWnd; + /// /// Type: UINT /// The application-defined identifier of the taskbar icon. The Shell uses either (hWnd plus uID) or guidItem to identify which icon to operate on when Shell_NotifyIcon is invoked. You can have multiple icons associated with a single hWnd by assigning each a different uID. If guidItem is specified, uID is ignored. /// Read more on docs.microsoft.com. /// internal uint uID; + /// Type: UINT internal uint uFlags; + /// /// Type: UINT /// An application-defined message identifier. The system uses this identifier to send notification messages to the window identified in hWnd. These notification messages are sent when a mouse event or hover occurs in the bounding rectangle of the icon, when the icon is selected or activated with the keyboard, or when those actions occur in the balloon notification. @@ -273,6 +293,7 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal uint uCallbackMessage; + /// /// Type: HICON /// A handle to the icon to be added, modified, or deleted. Windows XP and later support icons of up to 32 BPP. @@ -280,6 +301,7 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal HICON hIcon; + /// /// Type: TCHAR[64] /// A null-terminated string that specifies the text for a standard tooltip. It can have a maximum of 64 characters, including the terminating null character. @@ -287,33 +309,40 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal __ushort_128 szTip; + /// Type: DWORD internal uint dwState; + /// /// Type: DWORD /// Windows 2000 and later. A value that specifies which bits of the dwState member are retrieved or modified. The possible values are the same as those for dwState. For example, setting this member to NIS_HIDDEN causes only the item's hidden state to be modified while the icon sharing bit is ignored regardless of its value. /// Read more on docs.microsoft.com. /// internal uint dwStateMask; + /// /// Type: TCHAR[256] /// Windows 2000 and later. A null-terminated string that specifies the text to display in a balloon notification. It can have a maximum of 256 characters, including the terminating null character, but should be restricted to 200 characters in English to accommodate localization. To remove the balloon notification from the UI, either delete the icon (with NIM_DELETE) or set the NIF_INFO flag in uFlags and set szInfo to an empty string. /// Read more on docs.microsoft.com. /// internal __ushort_256 szInfo; + internal _Anonymous_e__Union Anonymous; + /// /// Type: TCHAR[64] /// Windows 2000 and later. A null-terminated string that specifies a title for a balloon notification. This title appears in a larger font immediately above the text. It can have a maximum of 64 characters, including the terminating null character, but should be restricted to 48 characters in English to accommodate localization. /// Read more on docs.microsoft.com. /// internal __ushort_64 szInfoTitle; + /// /// Type: DWORD /// Windows 2000 and later. Flags that can be set to modify the behavior and appearance of a balloon notification. The icon is placed to the left of the title. If the szInfoTitle member is zero-length, the icon is not shown. /// Read more on docs.microsoft.com. /// internal uint dwInfoFlags; + /// /// Type: GUID Windows XP and later. /// @@ -321,6 +350,7 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal global::System.Guid guidItem; + /// /// Type: HICON /// Windows Vista and later. The handle of a customized notification icon provided by the application that should be used independently of the notification area icon. If this member is non-NULL and the NIIF_USER flag is set in the dwInfoFlags member, this icon is used as the notification icon. If this member is NULL, the legacy behavior is carried out. @@ -328,17 +358,19 @@ namespace Windows.Win32 /// internal HICON hBalloonIcon; - internal struct __ushort_256 { internal ushort _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, _182, _183, _184, _185, _186, _187, _188, _189, _190, _191, _192, _193, _194, _195, _196, _197, _198, _199, _200, _201, _202, _203, _204, _205, _206, _207, _208, _209, _210, _211, _212, _213, _214, _215, _216, _217, _218, _219, _220, _221, _222, _223, _224, _225, _226, _227, _228, _229, _230, _231, _232, _233, _234, _235, _236, _237, _238, _239, _240, _241, _242, _243, _244, _245, _246, _247, _248, _249, _250, _251, _252, _253, _254, _255; + /// Always 256. internal int Length => 256; + /// /// Gets a ref to an individual element of the inline array. /// ⚠ Important ⚠: When this struct is on the stack, do not let the returned reference outlive the stack frame that defines it. /// internal ref ushort this[int index] => ref AsSpan()[index]; + /// /// Gets this inline array as a span. /// @@ -353,22 +385,25 @@ namespace Windows.Win32 { [FieldOffset(0)] internal uint uTimeout; + [FieldOffset(0)] internal uint uVersion; } } - internal struct __ushort_64 { internal ushort _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63; + /// Always 64. internal int Length => 64; + /// /// Gets a ref to an individual element of the inline array. /// ⚠ Important ⚠: When this struct is on the stack, do not let the returned reference outlive the stack frame that defines it. /// internal ref ushort this[int index] => ref AsSpan()[index]; + /// /// Gets this inline array as a span. /// @@ -378,7 +413,6 @@ namespace Windows.Win32 internal Span AsSpan() => MemoryMarshal.CreateSpan(ref _0, 64); } - /// Contains information that the system needs to display notifications in the notification area. Used by Shell_NotifyIcon. /// /// See Notifications in the Windows User Experience Interaction Guidelines for more information on notification UI and content best practices. @@ -397,20 +431,24 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal uint cbSize; + /// /// Type: HWND /// A handle to the window that receives notifications associated with an icon in the notification area. /// Read more on docs.microsoft.com. /// internal HWND hWnd; + /// /// Type: UINT /// The application-defined identifier of the taskbar icon. The Shell uses either (hWnd plus uID) or guidItem to identify which icon to operate on when Shell_NotifyIcon is invoked. You can have multiple icons associated with a single hWnd by assigning each a different uID. If guidItem is specified, uID is ignored. /// Read more on docs.microsoft.com. /// internal uint uID; + /// Type: UINT internal uint uFlags; + /// /// Type: UINT /// An application-defined message identifier. The system uses this identifier to send notification messages to the window identified in hWnd. These notification messages are sent when a mouse event or hover occurs in the bounding rectangle of the icon, when the icon is selected or activated with the keyboard, or when those actions occur in the balloon notification. @@ -421,6 +459,7 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal uint uCallbackMessage; + /// /// Type: HICON /// A handle to the icon to be added, modified, or deleted. Windows XP and later support icons of up to 32 BPP. @@ -428,6 +467,7 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal HICON hIcon; + /// /// Type: TCHAR[64] /// A null-terminated string that specifies the text for a standard tooltip. It can have a maximum of 64 characters, including the terminating null character. @@ -435,33 +475,40 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal __ushort_128 szTip; + /// Type: DWORD internal uint dwState; + /// /// Type: DWORD /// Windows 2000 and later. A value that specifies which bits of the dwState member are retrieved or modified. The possible values are the same as those for dwState. For example, setting this member to NIS_HIDDEN causes only the item's hidden state to be modified while the icon sharing bit is ignored regardless of its value. /// Read more on docs.microsoft.com. /// internal uint dwStateMask; + /// /// Type: TCHAR[256] /// Windows 2000 and later. A null-terminated string that specifies the text to display in a balloon notification. It can have a maximum of 256 characters, including the terminating null character, but should be restricted to 200 characters in English to accommodate localization. To remove the balloon notification from the UI, either delete the icon (with NIM_DELETE) or set the NIF_INFO flag in uFlags and set szInfo to an empty string. /// Read more on docs.microsoft.com. /// internal __ushort_256 szInfo; + internal _Anonymous_e__Union Anonymous; + /// /// Type: TCHAR[64] /// Windows 2000 and later. A null-terminated string that specifies a title for a balloon notification. This title appears in a larger font immediately above the text. It can have a maximum of 64 characters, including the terminating null character, but should be restricted to 48 characters in English to accommodate localization. /// Read more on docs.microsoft.com. /// internal __ushort_64 szInfoTitle; + /// /// Type: DWORD /// Windows 2000 and later. Flags that can be set to modify the behavior and appearance of a balloon notification. The icon is placed to the left of the title. If the szInfoTitle member is zero-length, the icon is not shown. /// Read more on docs.microsoft.com. /// internal uint dwInfoFlags; + /// /// Type: GUID Windows XP and later. /// @@ -469,6 +516,7 @@ namespace Windows.Win32 /// Read more on docs.microsoft.com. /// internal global::System.Guid guidItem; + /// /// Type: HICON /// Windows Vista and later. The handle of a customized notification icon provided by the application that should be used independently of the notification area icon. If this member is non-NULL and the NIIF_USER flag is set in the dwInfoFlags member, this icon is used as the notification icon. If this member is NULL, the legacy behavior is carried out. @@ -479,13 +527,16 @@ namespace Windows.Win32 internal struct __ushort_256 { internal ushort _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, _182, _183, _184, _185, _186, _187, _188, _189, _190, _191, _192, _193, _194, _195, _196, _197, _198, _199, _200, _201, _202, _203, _204, _205, _206, _207, _208, _209, _210, _211, _212, _213, _214, _215, _216, _217, _218, _219, _220, _221, _222, _223, _224, _225, _226, _227, _228, _229, _230, _231, _232, _233, _234, _235, _236, _237, _238, _239, _240, _241, _242, _243, _244, _245, _246, _247, _248, _249, _250, _251, _252, _253, _254, _255; + /// Always 256. internal int Length => 256; + /// /// Gets a ref to an individual element of the inline array. /// ⚠ Important ⚠: When this struct is on the stack, do not let the returned reference outlive the stack frame that defines it. /// internal ref ushort this[int index] => ref AsSpan()[index]; + /// /// Gets this inline array as a span. /// @@ -500,6 +551,7 @@ namespace Windows.Win32 { [FieldOffset(0)] internal uint uTimeout; + [FieldOffset(0)] internal uint uVersion; } diff --git a/Hyperbar.Windows.Win32/KeyIntrop.cs b/Hyperbar.Windows.Win32/KeyIntrop.cs index 8706fd3..4d3f41f 100644 --- a/Hyperbar.Windows.Win32/KeyIntrop.cs +++ b/Hyperbar.Windows.Win32/KeyIntrop.cs @@ -23,13 +23,13 @@ public class KeyInterop VirtualKey.Right, VirtualKey.Application, VirtualKey.RightWindows, - VirtualKey.LeftWindows ]; + VirtualKey.LeftWindows]; public static void Press(VirtualKey key) => SendKey(key, true); public static void Release(VirtualKey key) => SendKey(key, false); - public static unsafe void Type(VirtualKey key, + public static unsafe void Type(VirtualKey key, params VirtualKey[] modifierKeys) { foreach (VirtualKey modiferKey in modifierKeys) @@ -46,7 +46,7 @@ public class KeyInterop } } - private static unsafe void SendKey(VirtualKey key, + private static unsafe void SendKey(VirtualKey key, bool pressed) { INPUT input = new() @@ -80,4 +80,4 @@ public class KeyInterop PInvoke.SendInput(new Span(ref input), Marshal.SizeOf(input)); } -} +} \ No newline at end of file diff --git a/Hyperbar.Windows/App.xaml b/Hyperbar.Windows/App.xaml index 434a123..1c186ec 100644 --- a/Hyperbar.Windows/App.xaml +++ b/Hyperbar.Windows/App.xaml @@ -14,4 +14,4 @@ - + \ No newline at end of file diff --git a/Hyperbar.Windows/App.xaml.cs b/Hyperbar.Windows/App.xaml.cs index 1016aaf..0358633 100644 --- a/Hyperbar.Windows/App.xaml.cs +++ b/Hyperbar.Windows/App.xaml.cs @@ -1,14 +1,15 @@ -using Hyperbar.Windows.Controls; +using Hyperbar.Extensions; +using Hyperbar.Widget.Contextual; +using Hyperbar.Windows.Controls; +using Hyperbar.Windows.Primary; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.UI.Xaml; -using Hyperbar.Widget.Contextual; -using Hyperbar.Windows.Primary; namespace Hyperbar.Windows; -public partial class App : +public partial class App : Application { public App() => InitializeComponent(); @@ -28,7 +29,7 @@ public partial class App : }) .ConfigureServices((context, services) => { - services.AddSingleton(provider => + services.AddSingleton(provider => new ServiceFactory((type, parameters) => ActivatorUtilities.CreateInstance(provider, type, parameters!))); services.AddHostedService(); @@ -48,7 +49,7 @@ public partial class App : { foreach (IWidgetContext widgetContext in services.GetServices()) { - if (widgetContext.ServiceProvider.GetService() is + if (widgetContext.ServiceProvider.GetService() is IWidgetViewModel viewModel) { yield return viewModel; @@ -56,11 +57,11 @@ public partial class App : } } - return Resolve(provider); + return Resolve(provider); }); }) .Build(); await host.RunAsync(); } -} +} \ No newline at end of file diff --git a/Hyperbar.Windows/Lifecycles/AppInitializer.cs b/Hyperbar.Windows/Lifecycles/AppInitializer.cs index f61f4bb..9df79ff 100644 --- a/Hyperbar.Windows/Lifecycles/AppInitializer.cs +++ b/Hyperbar.Windows/Lifecycles/AppInitializer.cs @@ -5,7 +5,7 @@ namespace Hyperbar.Windows; public class AppInitializer([FromKeyedServices(nameof(CommandViewModel))] CommandView view, [FromKeyedServices(nameof(CommandViewModel))] CommandViewModel viewModel, - DesktopFlyout desktopFlyout) : + DesktopFlyout desktopFlyout) : IInitializer { public Task InitializeAsync() @@ -17,4 +17,4 @@ public class AppInitializer([FromKeyedServices(nameof(CommandViewModel))] Comman return Task.CompletedTask; } -} +} \ No newline at end of file diff --git a/Hyperbar.Windows/Lifecycles/IServiceCollectionExtensions.cs b/Hyperbar.Windows/Lifecycles/IServiceCollectionExtensions.cs index f6af132..f2e722f 100644 --- a/Hyperbar.Windows/Lifecycles/IServiceCollectionExtensions.cs +++ b/Hyperbar.Windows/Lifecycles/IServiceCollectionExtensions.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using Hyperbar.Extensions; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; namespace Hyperbar.Windows diff --git a/Hyperbar.Windows/Templates/ITemplateGeneratorFactory.cs b/Hyperbar.Windows/Templates/ITemplateGeneratorFactory.cs index ec1b20b..574ca9a 100644 --- a/Hyperbar.Windows/Templates/ITemplateGeneratorFactory.cs +++ b/Hyperbar.Windows/Templates/ITemplateGeneratorFactory.cs @@ -2,7 +2,6 @@ namespace Hyperbar.Windows { - public interface ITemplateGeneratorFactory { DataTemplate Create(); diff --git a/Hyperbar.Windows/Templates/TemplateGeneratorControl.cs b/Hyperbar.Windows/Templates/TemplateGeneratorControl.cs index 72efc22..f74c3f8 100644 --- a/Hyperbar.Windows/Templates/TemplateGeneratorControl.cs +++ b/Hyperbar.Windows/Templates/TemplateGeneratorControl.cs @@ -3,7 +3,7 @@ using Microsoft.UI.Xaml.Controls; namespace Hyperbar.Windows; -public class TemplateGeneratorControl : +public class TemplateGeneratorControl : ContentControl { public TemplateGeneratorControl() @@ -18,4 +18,4 @@ public class TemplateGeneratorControl : Content = templatedViewModel.TemplateFactory.Create(DataContext.GetType().Name); } } -} +} \ No newline at end of file diff --git a/Hyperbar.Windows/Templates/TemplateGeneratorFactory.cs b/Hyperbar.Windows/Templates/TemplateGeneratorFactory.cs index 05c46e6..0e4196a 100644 --- a/Hyperbar.Windows/Templates/TemplateGeneratorFactory.cs +++ b/Hyperbar.Windows/Templates/TemplateGeneratorFactory.cs @@ -3,17 +3,17 @@ using Microsoft.UI.Xaml.Markup; namespace Hyperbar.Windows; -public class TemplateGeneratorFactory : +public class TemplateGeneratorFactory : ITemplateGeneratorFactory { public DataTemplate Create() { string xamlString = @" - "; return (DataTemplate)XamlReader.Load(xamlString); } -} +} \ No newline at end of file diff --git a/Hyperbar.Windows/Views/CommandView.xaml b/Hyperbar.Windows/Views/CommandView.xaml index 94e3eb5..2c804ab 100644 --- a/Hyperbar.Windows/Views/CommandView.xaml +++ b/Hyperbar.Windows/Views/CommandView.xaml @@ -10,4 +10,4 @@ - + \ No newline at end of file diff --git a/Hyperbar.Windows/Views/CommandView.xaml.cs b/Hyperbar.Windows/Views/CommandView.xaml.cs index b41eb95..35b6abc 100644 --- a/Hyperbar.Windows/Views/CommandView.xaml.cs +++ b/Hyperbar.Windows/Views/CommandView.xaml.cs @@ -3,7 +3,7 @@ using Microsoft.UI.Xaml.Input; namespace Hyperbar.Windows; -public sealed partial class CommandView : +public sealed partial class CommandView : UserControl { public CommandView() => InitializeComponent(); @@ -12,4 +12,4 @@ public sealed partial class CommandView : { base.OnKeyDown(e); } -} +} \ No newline at end of file diff --git a/Hyperbar.Windows/Views/CommandViewModel.cs b/Hyperbar.Windows/Views/CommandViewModel.cs index 1fd43a1..db5d47d 100644 --- a/Hyperbar.Windows/Views/CommandViewModel.cs +++ b/Hyperbar.Windows/Views/CommandViewModel.cs @@ -1,6 +1,6 @@ namespace Hyperbar.Windows; -public partial class CommandViewModel : +public partial class CommandViewModel : ObservableCollectionViewModel, ITemplatedViewModel { @@ -13,4 +13,4 @@ public partial class CommandViewModel : } public ITemplateFactory TemplateFactory { get; } -} +} \ No newline at end of file diff --git a/Hyperbar.Windows/Views/WidgetButtonView.xaml b/Hyperbar.Windows/Views/WidgetButtonView.xaml index b7d76d9..b1651a1 100644 --- a/Hyperbar.Windows/Views/WidgetButtonView.xaml +++ b/Hyperbar.Windows/Views/WidgetButtonView.xaml @@ -17,4 +17,4 @@ Height="{StaticResource ButtonHeight}" Command="{Binding Click}" Content="{Binding Icon}" /> - + \ No newline at end of file diff --git a/Hyperbar.Windows/Views/WidgetButtonView.xaml.cs b/Hyperbar.Windows/Views/WidgetButtonView.xaml.cs index a44d56f..c4a005f 100644 --- a/Hyperbar.Windows/Views/WidgetButtonView.xaml.cs +++ b/Hyperbar.Windows/Views/WidgetButtonView.xaml.cs @@ -2,8 +2,8 @@ using Microsoft.UI.Xaml.Controls; namespace Hyperbar.Windows; -public sealed partial class WidgetButtonView : +public sealed partial class WidgetButtonView : UserControl { public WidgetButtonView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Hyperbar.Windows/Views/WidgetView.xaml b/Hyperbar.Windows/Views/WidgetView.xaml index b683edd..5baccbc 100644 --- a/Hyperbar.Windows/Views/WidgetView.xaml +++ b/Hyperbar.Windows/Views/WidgetView.xaml @@ -10,4 +10,4 @@ - + \ No newline at end of file diff --git a/Hyperbar.Windows/Views/WidgetView.xaml.cs b/Hyperbar.Windows/Views/WidgetView.xaml.cs index 67c9631..d77a38f 100644 --- a/Hyperbar.Windows/Views/WidgetView.xaml.cs +++ b/Hyperbar.Windows/Views/WidgetView.xaml.cs @@ -7,4 +7,4 @@ public sealed partial class WidgetView : IWidgetView { public WidgetView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Hyperbar/Configuration/ConfigurationWriter.cs b/Hyperbar/Configuration/ConfigurationWriter.cs index 830eb85..0495761 100644 --- a/Hyperbar/Configuration/ConfigurationWriter.cs +++ b/Hyperbar/Configuration/ConfigurationWriter.cs @@ -6,8 +6,8 @@ namespace Hyperbar; public class ConfigurationWriter(string path, string section, - JsonSerializerOptions? serializerOptions = null) : - IConfigurationWriter + JsonSerializerOptions? serializerOptions = null) : + IConfigurationWriter where TConfiguration : class, new() { diff --git a/Hyperbar/Configuration/IConfigurationWriter.cs b/Hyperbar/Configuration/IConfigurationWriter.cs index d17c420..e9b394c 100644 --- a/Hyperbar/Configuration/IConfigurationWriter.cs +++ b/Hyperbar/Configuration/IConfigurationWriter.cs @@ -1,7 +1,7 @@ namespace Hyperbar; public interface IConfigurationWriter - where TConfiguration : + where TConfiguration : class, new() { void Write(Action updateDelegate); diff --git a/Hyperbar/Configuration/IWritableConfiguration.cs b/Hyperbar/Configuration/IWritableConfiguration.cs index e1fb54c..26c0446 100644 --- a/Hyperbar/Configuration/IWritableConfiguration.cs +++ b/Hyperbar/Configuration/IWritableConfiguration.cs @@ -2,11 +2,11 @@ namespace Hyperbar; -public interface IWritableConfiguration : - IOptionsSnapshot +public interface IWritableConfiguration : + IOptionsSnapshot where TConfiguration : class, new() { - void Write(Action updateAction, + void Write(Action updateAction, bool reload = true); -} +} \ No newline at end of file diff --git a/Hyperbar/Configuration/WritableConfiguration.cs b/Hyperbar/Configuration/WritableConfiguration.cs index 8e42074..fb589b2 100644 --- a/Hyperbar/Configuration/WritableConfiguration.cs +++ b/Hyperbar/Configuration/WritableConfiguration.cs @@ -5,16 +5,16 @@ namespace Hyperbar; public class WritableConfiguration(IConfigurationWriter writer, IOptionsMonitor options, - IConfiguration configuration) : - IWritableConfiguration - where TConfiguration : + IConfiguration configuration) : + IWritableConfiguration + where TConfiguration : class, new() { public TConfiguration Value => options.CurrentValue; public TConfiguration Get(string? name) => options.Get(name); - public void Write(Action updateDelegate, + public void Write(Action updateDelegate, bool reload = true) { writer.Write(updateDelegate); @@ -23,4 +23,4 @@ public class WritableConfiguration(IConfigurationWriter(this IServiceCollection services, string section, string path = "Settings.json", - Action? serializerDelegate = null) - where TConfiguration : + Action? serializerDelegate = null) + where TConfiguration : class, new() { - services.AddOptions(); - services.AddSingleton>(new ConfigureNamedOptions("", args => { })); + _ = services.AddOptions(); + _ = services.AddSingleton>(new ConfigureNamedOptions("", args => { })); - services.AddTransient>(provider => + _ = services.AddTransient>(provider => { string? jsonFilePath = null; if (provider.GetService() is IHostEnvironment hostEnvironment) @@ -50,7 +50,7 @@ public static class IServiceCollectionExtensions return new ConfigurationWriter(jsonFilePath, section, defaultSerializerOptions); }); - services.AddTransient, WritableConfiguration>(); + _ = services.AddTransient, WritableConfiguration>(); return services; } @@ -62,14 +62,14 @@ public static class IServiceCollectionExtensions Type templateType = typeof(IWidgetView); string key = contentType.Name; - - services.AddTransient(typeof(IWidgetViewModel), contentType); + + _ = services.AddTransient(typeof(IWidgetViewModel), contentType); services.TryAddTransient(templateType, provider => provider.GetService()!); - services.AddKeyedTransient(typeof(IWidgetViewModel), key, contentType); - services.TryAddKeyedTransient(key, (provider, key) => provider.GetService()!); + _ = services.AddKeyedTransient(typeof(IWidgetViewModel), key, contentType); + services.TryAddKeyedTransient(key, (provider, key) => provider.GetService()!); - services.AddTransient(provider => new ContentTemplateDescriptor + _ = services.AddTransient(provider => new ContentTemplateDescriptor { ContentType = contentType, TemplateType = templateType, @@ -88,13 +88,13 @@ public static class IServiceCollectionExtensions string key = contentType.Name; - services.AddTransient(typeof(IWidgetViewModel), contentType); + _ = services.AddTransient(typeof(IWidgetViewModel), contentType); services.TryAddTransient(templateType); - services.AddKeyedTransient(typeof(IWidgetViewModel), key, contentType); + _ = services.AddKeyedTransient(typeof(IWidgetViewModel), key, contentType); services.TryAddKeyedTransient(templateType, key); - services.AddTransient(provider => new ContentTemplateDescriptor + _ = services.AddTransient(provider => new ContentTemplateDescriptor { ContentType = contentType, TemplateType = templateType, @@ -112,13 +112,13 @@ public static class IServiceCollectionExtensions key ??= contentType.Name; - services.AddTransient(contentType); + _ = services.AddTransient(contentType); services.TryAddTransient(templateType); - services.AddKeyedTransient(contentType, key); - services.AddKeyedTransient(templateType, key); - - services.AddTransient(provider => new ContentTemplateDescriptor + _ = services.AddKeyedTransient(contentType, key); + _ = services.AddKeyedTransient(templateType, key); + + _ = services.AddTransient(provider => new ContentTemplateDescriptor { ContentType = contentType, TemplateType = templateType, @@ -127,4 +127,4 @@ public static class IServiceCollectionExtensions return services; } -} +} \ No newline at end of file diff --git a/Hyperbar/Factories/IServiceFactory.cs b/Hyperbar/Factories/IServiceFactory.cs index 04e0c0d..1ad38d7 100644 --- a/Hyperbar/Factories/IServiceFactory.cs +++ b/Hyperbar/Factories/IServiceFactory.cs @@ -3,4 +3,4 @@ public interface IServiceFactory { TService Create(params object?[] parameters); -} +} \ No newline at end of file diff --git a/Hyperbar/Factories/ServiceFactory.cs b/Hyperbar/Factories/ServiceFactory.cs index 2165dc9..600ce40 100644 --- a/Hyperbar/Factories/ServiceFactory.cs +++ b/Hyperbar/Factories/ServiceFactory.cs @@ -1,8 +1,8 @@ namespace Hyperbar; -public class ServiceFactory(Func factory) : +public class ServiceFactory(Func factory) : IServiceFactory { - public TService Create(params object?[] parameters) => + public TService Create(params object?[] parameters) => (TService)factory(typeof(TService), parameters); -} +} \ No newline at end of file diff --git a/Hyperbar/Lifecycles/AppService.cs b/Hyperbar/Lifecycles/AppService.cs index 3fd1fb2..f75dabf 100644 --- a/Hyperbar/Lifecycles/AppService.cs +++ b/Hyperbar/Lifecycles/AppService.cs @@ -17,4 +17,4 @@ public class AppService(IEnumerable initializers) : { throw new NotImplementedException(); } -} +} \ No newline at end of file diff --git a/Hyperbar/Lifecycles/IInitializer.cs b/Hyperbar/Lifecycles/IInitializer.cs index 57714a1..f1d9320 100644 --- a/Hyperbar/Lifecycles/IInitializer.cs +++ b/Hyperbar/Lifecycles/IInitializer.cs @@ -7,5 +7,4 @@ public interface IInitializer public interface IDataTemplateSelector { - } \ No newline at end of file diff --git a/Hyperbar/Lifecycles/IWidgetBuilder.cs b/Hyperbar/Lifecycles/IWidgetBuilder.cs index 8734d65..7365e98 100644 --- a/Hyperbar/Lifecycles/IWidgetBuilder.cs +++ b/Hyperbar/Lifecycles/IWidgetBuilder.cs @@ -5,4 +5,4 @@ namespace Hyperbar; public interface IWidgetBuilder { void Create(IServiceCollection services); -} +} \ No newline at end of file diff --git a/Hyperbar/Lifecycles/IWidgetContext.cs b/Hyperbar/Lifecycles/IWidgetContext.cs index 4a8766f..17919b0 100644 --- a/Hyperbar/Lifecycles/IWidgetContext.cs +++ b/Hyperbar/Lifecycles/IWidgetContext.cs @@ -3,4 +3,4 @@ public interface IWidgetContext { IServiceProvider ServiceProvider { get; } -} +} \ No newline at end of file diff --git a/Hyperbar/Mediators/CommandClassHandlerWrapper.cs b/Hyperbar/Mediators/CommandClassHandlerWrapper.cs index 4d2bc79..58bfe0e 100644 --- a/Hyperbar/Mediators/CommandClassHandlerWrapper.cs +++ b/Hyperbar/Mediators/CommandClassHandlerWrapper.cs @@ -1,7 +1,7 @@ namespace Hyperbar; -public class CommandClassHandlerWrapper - where TRequest : +public class CommandClassHandlerWrapper + where TRequest : class, ICommand { @@ -16,7 +16,7 @@ public class CommandClassHandlerWrapper { MessageHandlerDelegate handlerCopy = handler; IPipelineBehavior pipelineCopy = pipeline; - handler = (TRequest message, CancellationToken cancellationToken) => + handler = (TRequest message, CancellationToken cancellationToken) => pipelineCopy.Handle(message, handlerCopy, cancellationToken); } @@ -24,4 +24,4 @@ public class CommandClassHandlerWrapper } public ValueTask Handle(TRequest request, CancellationToken cancellationToken) => handler(request, cancellationToken); -} +} \ No newline at end of file diff --git a/Hyperbar/Mediators/ICommand.cs b/Hyperbar/Mediators/ICommand.cs index 29e50e7..605aacb 100644 --- a/Hyperbar/Mediators/ICommand.cs +++ b/Hyperbar/Mediators/ICommand.cs @@ -2,5 +2,4 @@ public interface ICommand : ICommand; -public interface ICommand : IMessage; - +public interface ICommand : IMessage; \ No newline at end of file diff --git a/Hyperbar/Mediators/ICommandHandler.cs b/Hyperbar/Mediators/ICommandHandler.cs index 210a092..e83363a 100644 --- a/Hyperbar/Mediators/ICommandHandler.cs +++ b/Hyperbar/Mediators/ICommandHandler.cs @@ -1,13 +1,26 @@ namespace Hyperbar; +public record KeyAcceleratorCommand(string Key, string[]? Modifiers = null) : + ICommand; + +public class KeyAcceleratorCommandHanler : + ICommandHandler +{ + public ValueTask Handle(KeyAcceleratorCommand command, + CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } +} + public interface ICommandHandler : ICommandHandler - where TCommand : + where TCommand : ICommand; -public interface ICommandHandler - where TCommand : +public interface ICommandHandler + where TCommand : ICommand { - ValueTask Handle(TCommand command, + ValueTask Handle(TCommand command, CancellationToken cancellationToken); -} +} \ No newline at end of file diff --git a/Hyperbar/Mediators/IMediator.cs b/Hyperbar/Mediators/IMediator.cs index 68eab3c..197cf61 100644 --- a/Hyperbar/Mediators/IMediator.cs +++ b/Hyperbar/Mediators/IMediator.cs @@ -2,9 +2,9 @@ public interface IMediator { - ValueTask Publish(TNotification notification, - CancellationToken cancellationToken = default) - where TNotification : + ValueTask Publish(TNotification notification, + CancellationToken cancellationToken = default) + where TNotification : INotification; ValueTask Send(IRequest request, @@ -13,12 +13,11 @@ public interface IMediator ValueTask Send(ICommand command, CancellationToken cancellationToken = default); - ValueTask Send(IQuery query, + ValueTask Send(IQuery query, CancellationToken cancellationToken = default); - ValueTask Send(object message, CancellationToken + ValueTask Send(object message, CancellationToken cancellationToken = default); void Subscribe(object subscriber); -} - +} \ No newline at end of file diff --git a/Hyperbar/Mediators/IMessage.cs b/Hyperbar/Mediators/IMessage.cs index 45718a7..a3c937b 100644 --- a/Hyperbar/Mediators/IMessage.cs +++ b/Hyperbar/Mediators/IMessage.cs @@ -1,4 +1,3 @@ namespace Hyperbar; -public interface IMessage; - +public interface IMessage; \ No newline at end of file diff --git a/Hyperbar/Mediators/INotification.cs b/Hyperbar/Mediators/INotification.cs index a59c987..9fc54c3 100644 --- a/Hyperbar/Mediators/INotification.cs +++ b/Hyperbar/Mediators/INotification.cs @@ -1,4 +1,3 @@ namespace Hyperbar; -public interface INotification : IMessage; - +public interface INotification : IMessage; \ No newline at end of file diff --git a/Hyperbar/Mediators/INotificationHandler.cs b/Hyperbar/Mediators/INotificationHandler.cs index 77b1523..61e1d51 100644 --- a/Hyperbar/Mediators/INotificationHandler.cs +++ b/Hyperbar/Mediators/INotificationHandler.cs @@ -1,10 +1,9 @@ namespace Hyperbar; -public interface INotificationHandler - where TNotification : +public interface INotificationHandler + where TNotification : INotification { - ValueTask Handle(TNotification notification, + ValueTask Handle(TNotification notification, CancellationToken cancellationToken); -} - +} \ No newline at end of file diff --git a/Hyperbar/Mediators/IPipelineBehavior.cs b/Hyperbar/Mediators/IPipelineBehavior.cs index 159fe80..036a8d2 100644 --- a/Hyperbar/Mediators/IPipelineBehavior.cs +++ b/Hyperbar/Mediators/IPipelineBehavior.cs @@ -1,12 +1,11 @@ namespace Hyperbar; -public interface IPipelineBehavior - where TMessage : - notnull, +public interface IPipelineBehavior + where TMessage : + notnull, IMessage { ValueTask Handle(TMessage message, MessageHandlerDelegate next, CancellationToken cancellationToken = default); -} - +} \ No newline at end of file diff --git a/Hyperbar/Mediators/IQuery.cs b/Hyperbar/Mediators/IQuery.cs index 2efc47e..e8c15ac 100644 --- a/Hyperbar/Mediators/IQuery.cs +++ b/Hyperbar/Mediators/IQuery.cs @@ -1,3 +1,3 @@ namespace Hyperbar; -public interface IQuery : IMessage; +public interface IQuery : IMessage; \ No newline at end of file diff --git a/Hyperbar/Mediators/IQueryHandler.cs b/Hyperbar/Mediators/IQueryHandler.cs index 5f1e9ff..e2b49d4 100644 --- a/Hyperbar/Mediators/IQueryHandler.cs +++ b/Hyperbar/Mediators/IQueryHandler.cs @@ -1,9 +1,9 @@ namespace Hyperbar; -public interface IQueryHandler +public interface IQueryHandler where TQuery : IQuery { - ValueTask Handle(TQuery query, + ValueTask Handle(TQuery query, CancellationToken cancellationToken); -} +} \ No newline at end of file diff --git a/Hyperbar/Mediators/IRequest.cs b/Hyperbar/Mediators/IRequest.cs index 647e850..1790481 100644 --- a/Hyperbar/Mediators/IRequest.cs +++ b/Hyperbar/Mediators/IRequest.cs @@ -2,4 +2,4 @@ public interface IRequest : IMessage; -public interface IRequest : IRequest; +public interface IRequest : IRequest; \ No newline at end of file diff --git a/Hyperbar/Mediators/IRequestHandler.cs b/Hyperbar/Mediators/IRequestHandler.cs index ed4941f..5bd8553 100644 --- a/Hyperbar/Mediators/IRequestHandler.cs +++ b/Hyperbar/Mediators/IRequestHandler.cs @@ -4,14 +4,13 @@ public interface IRequestHandler where TRequest : IRequest { - ValueTask Handle(TRequest request, + ValueTask Handle(TRequest request, CancellationToken cancellationToken); } -public interface IRequestHandler : - IRequestHandler - where TRequest : +public interface IRequestHandler : + IRequestHandler + where TRequest : IRequest { - -} +} \ No newline at end of file diff --git a/Hyperbar/Mediators/Mediator.cs b/Hyperbar/Mediators/Mediator.cs index f77f1f9..5b95f0c 100644 --- a/Hyperbar/Mediators/Mediator.cs +++ b/Hyperbar/Mediators/Mediator.cs @@ -3,17 +3,17 @@ using System.Runtime.CompilerServices; namespace Hyperbar; -public class Mediator(IServiceProvider provider) : +public class Mediator(IServiceProvider provider) : IMediator { private readonly ConditionalWeakTable handlers = []; - public ValueTask Publish(TNotification notification, - CancellationToken cancellationToken = default) - where TNotification : + public ValueTask Publish(TNotification notification, + CancellationToken cancellationToken = default) + where TNotification : INotification { - List> handlers = + List> handlers = provider.GetServices>().ToList(); foreach (KeyValuePair handler in this.handlers) @@ -36,7 +36,7 @@ public class Mediator(IServiceProvider provider) : return default; } - public ValueTask Send(IRequest request, + public ValueTask Send(IRequest request, CancellationToken cancellationToken = default) { dynamic? handler = provider.GetService(typeof(RequestClassHandlerWrapper<,>) @@ -50,7 +50,7 @@ public class Mediator(IServiceProvider provider) : return default; } - public ValueTask Send(ICommand command, + public ValueTask Send(ICommand command, CancellationToken cancellationToken = default) { dynamic? handler = provider.GetService(typeof(CommandClassHandlerWrapper<,>) @@ -64,7 +64,7 @@ public class Mediator(IServiceProvider provider) : return default; } - public ValueTask Send(IQuery query, + public ValueTask Send(IQuery query, CancellationToken cancellationToken = default) { dynamic? handler = provider.GetService(typeof(QueryClassHandlerWrapper<,>) @@ -146,4 +146,4 @@ public class Mediator(IServiceProvider provider) : } } } -} +} \ No newline at end of file diff --git a/Hyperbar/Mediators/MessageHandlerDelegate.cs b/Hyperbar/Mediators/MessageHandlerDelegate.cs index 5d39bfa..3f0271e 100644 --- a/Hyperbar/Mediators/MessageHandlerDelegate.cs +++ b/Hyperbar/Mediators/MessageHandlerDelegate.cs @@ -4,4 +4,4 @@ public delegate ValueTask MessageHandlerDelegate CancellationToken cancellationToken) where TMessage : notnull, - IMessage; + IMessage; \ No newline at end of file diff --git a/Hyperbar/Mediators/QueryClassHandlerWrapper.cs b/Hyperbar/Mediators/QueryClassHandlerWrapper.cs index 6fd0c40..e96165f 100644 --- a/Hyperbar/Mediators/QueryClassHandlerWrapper.cs +++ b/Hyperbar/Mediators/QueryClassHandlerWrapper.cs @@ -1,7 +1,7 @@ namespace Hyperbar; -public class QueryClassHandlerWrapper - where TRequest : +public class QueryClassHandlerWrapper + where TRequest : class, IQuery { @@ -25,4 +25,4 @@ public class QueryClassHandlerWrapper public ValueTask Handle(TRequest request, CancellationToken cancellationToken) => handler(request, cancellationToken); -} +} \ No newline at end of file diff --git a/Hyperbar/Mediators/RequestClassHandlerWrapper.cs b/Hyperbar/Mediators/RequestClassHandlerWrapper.cs index 79bfd15..dc4f424 100644 --- a/Hyperbar/Mediators/RequestClassHandlerWrapper.cs +++ b/Hyperbar/Mediators/RequestClassHandlerWrapper.cs @@ -1,8 +1,8 @@ namespace Hyperbar; public class RequestClassHandlerWrapper - where TRequest : - class, + where TRequest : + class, IRequest { private readonly MessageHandlerDelegate handler; @@ -16,7 +16,7 @@ public class RequestClassHandlerWrapper MessageHandlerDelegate handlerCopy = handler; IPipelineBehavior pipelineCopy = pipeline; - handler = (TRequest message, CancellationToken cancellationToken) => + handler = (TRequest message, CancellationToken cancellationToken) => pipelineCopy.Handle(message, handlerCopy, cancellationToken); } @@ -24,4 +24,4 @@ public class RequestClassHandlerWrapper } public ValueTask Handle(TRequest request, CancellationToken cancellationToken) => handler(request, cancellationToken); -} +} \ No newline at end of file diff --git a/Hyperbar/Mediators/Unit.cs b/Hyperbar/Mediators/Unit.cs index 7eb31c6..322c1c0 100644 --- a/Hyperbar/Mediators/Unit.cs +++ b/Hyperbar/Mediators/Unit.cs @@ -1,8 +1,8 @@ namespace Hyperbar; -public readonly struct Unit : - IEquatable, - IComparable, +public readonly struct Unit : + IEquatable, + IComparable, IComparable { private static readonly Unit value = new(); @@ -26,5 +26,4 @@ public readonly struct Unit : public static bool operator !=(Unit _, Unit __) => false; public override string ToString() => "()"; -} - +} \ No newline at end of file diff --git a/Hyperbar/Templates/ContentTemplateDescriptor.cs b/Hyperbar/Templates/ContentTemplateDescriptor.cs index b85314e..eed118d 100644 --- a/Hyperbar/Templates/ContentTemplateDescriptor.cs +++ b/Hyperbar/Templates/ContentTemplateDescriptor.cs @@ -8,5 +8,4 @@ public record ContentTemplateDescriptor : public required Type TemplateType { get; set; } public required object Key { get; set; } -} - +} \ No newline at end of file diff --git a/Hyperbar/Templates/IContentTemplateDescriptor.cs b/Hyperbar/Templates/IContentTemplateDescriptor.cs index 7f8ff19..8b6b56f 100644 --- a/Hyperbar/Templates/IContentTemplateDescriptor.cs +++ b/Hyperbar/Templates/IContentTemplateDescriptor.cs @@ -7,5 +7,4 @@ public interface IContentTemplateDescriptor object Key { get; set; } Type TemplateType { get; set; } -} - +} \ No newline at end of file diff --git a/Hyperbar/Templates/ITemplateFactory.cs b/Hyperbar/Templates/ITemplateFactory.cs index 73bf234..7ab6c1a 100644 --- a/Hyperbar/Templates/ITemplateFactory.cs +++ b/Hyperbar/Templates/ITemplateFactory.cs @@ -3,4 +3,4 @@ public interface ITemplateFactory { object? Create(object key); -} +} \ No newline at end of file diff --git a/Hyperbar/Templates/ITemplatedViewModel.cs b/Hyperbar/Templates/ITemplatedViewModel.cs index 04a61f1..9dbb8cd 100644 --- a/Hyperbar/Templates/ITemplatedViewModel.cs +++ b/Hyperbar/Templates/ITemplatedViewModel.cs @@ -3,4 +3,4 @@ public interface ITemplatedViewModel { ITemplateFactory TemplateFactory { get; } -} +} \ No newline at end of file diff --git a/Hyperbar/Views/IWidgetComponentViewModel.cs b/Hyperbar/Views/IWidgetComponentViewModel.cs index 3906cb9..5192f6c 100644 --- a/Hyperbar/Views/IWidgetComponentViewModel.cs +++ b/Hyperbar/Views/IWidgetComponentViewModel.cs @@ -2,5 +2,4 @@ public interface IWidgetComponentViewModel { - } \ No newline at end of file diff --git a/Hyperbar/Views/IWidgetView.cs b/Hyperbar/Views/IWidgetView.cs index 1e5b373..17e5081 100644 --- a/Hyperbar/Views/IWidgetView.cs +++ b/Hyperbar/Views/IWidgetView.cs @@ -2,5 +2,4 @@ public interface IWidgetView { - -} +} \ No newline at end of file diff --git a/Hyperbar/Views/IWidgetViewModel.cs b/Hyperbar/Views/IWidgetViewModel.cs index 34e8627..0028736 100644 --- a/Hyperbar/Views/IWidgetViewModel.cs +++ b/Hyperbar/Views/IWidgetViewModel.cs @@ -2,5 +2,4 @@ public interface IWidgetViewModel { - -} +} \ No newline at end of file diff --git a/Hyperbar/Views/ObservableCollectionViewModel.cs b/Hyperbar/Views/ObservableCollectionViewModel.cs index 20898f3..70cd952 100644 --- a/Hyperbar/Views/ObservableCollectionViewModel.cs +++ b/Hyperbar/Views/ObservableCollectionViewModel.cs @@ -13,7 +13,7 @@ public class ObservableCollectionViewModel(IServiceFactory serviceFactory return item; } - public TItem Add(params object?[] parameters) + public TItem Add(params object?[] parameters) where T : TItem { T? item = serviceFactory.Create(parameters); @@ -44,5 +44,4 @@ public class ObservableCollectionViewModel(IServiceFactory serviceFactory public class ObservableCollectionViewModel(IServiceFactory serviceFactory) : ObservableCollectionViewModel(serviceFactory) { - -} +} \ No newline at end of file diff --git a/Hyperbar/Views/WidgetButtonViewModel.cs b/Hyperbar/Views/WidgetButtonViewModel.cs index 9d5033c..3fa76d0 100644 --- a/Hyperbar/Views/WidgetButtonViewModel.cs +++ b/Hyperbar/Views/WidgetButtonViewModel.cs @@ -22,4 +22,4 @@ public partial class WidgetButtonViewModel : click = new RelayCommand(action); } } -} +} \ No newline at end of file diff --git a/Hyperbar/Views/WidgetComponentViewModelBase.cs b/Hyperbar/Views/WidgetComponentViewModelBase.cs index ec5c82c..c175285 100644 --- a/Hyperbar/Views/WidgetComponentViewModelBase.cs +++ b/Hyperbar/Views/WidgetComponentViewModelBase.cs @@ -8,4 +8,4 @@ public partial class WidgetComponentViewModelBase(ITemplateFactory templateFacto ITemplatedViewModel { public ITemplateFactory TemplateFactory => templateFactory; -} +} \ No newline at end of file diff --git a/Hyperbar/Views/WidgetViewModelBase.cs b/Hyperbar/Views/WidgetViewModelBase.cs index 303d8d3..790b1a6 100644 --- a/Hyperbar/Views/WidgetViewModelBase.cs +++ b/Hyperbar/Views/WidgetViewModelBase.cs @@ -7,4 +7,4 @@ public class WidgetViewModelBase(ITemplateFactory templateFactory, ITemplatedViewModel { public ITemplateFactory TemplateFactory => templateFactory; -} +} \ No newline at end of file