diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/CommandItemViewModel.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/CommandItemViewModel.cs index 24dd9e1788..e8e20974de 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/CommandItemViewModel.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/CommandItemViewModel.cs @@ -190,7 +190,7 @@ public partial class CommandItemViewModel : ExtensionObjectViewModel, ICommandBa contextItem.SlowInitializeProperties(); }); - if (!string.IsNullOrEmpty(model.Command.Name)) + if (!string.IsNullOrEmpty(model.Command?.Name)) { _defaultCommandContextItem = new(new CommandContextItem(model.Command!), PageContext) { diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/FallbackSystemCommandItem.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/FallbackSystemCommandItem.cs index 94b23e3e0d..6dfe81af1b 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/FallbackSystemCommandItem.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/FallbackSystemCommandItem.cs @@ -32,6 +32,7 @@ internal sealed partial class FallbackSystemCommandItem : FallbackCommandItem { if (string.IsNullOrWhiteSpace(query)) { + Command = null; Title = string.Empty; Subtitle = string.Empty; return; @@ -58,6 +59,7 @@ internal sealed partial class FallbackSystemCommandItem : FallbackCommandItem if (result == null) { + Command = null; Title = string.Empty; Subtitle = string.Empty; diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Pages/SystemCommandPage.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Pages/SystemCommandPage.cs index 7bfd7bb4e4..3d02cdf18f 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Pages/SystemCommandPage.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Pages/SystemCommandPage.cs @@ -10,12 +10,12 @@ namespace Microsoft.CmdPal.Ext.System.Pages; public sealed partial class SystemCommandPage : ListPage { - private SettingsManager _settingsManager; + private readonly SettingsManager _settingsManager; public SystemCommandPage(SettingsManager settingsManager) { - Title = Resources.Microsoft_plugin_ext_system_page_name; - Name = Resources.Microsoft_plugin_ext_system_page_name; + Title = Resources.Microsoft_plugin_ext_system_page_title; + Name = Resources.Microsoft_plugin_command_name_open; Icon = IconHelpers.FromRelativePath("Assets\\SystemCommand.svg"); _settingsManager = settingsManager; ShowDetails = true; diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.Designer.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.Designer.cs index 1574a2aa0d..1cfa1a6353 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.Designer.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.Designer.cs @@ -205,7 +205,7 @@ namespace Microsoft.CmdPal.Ext.System { } /// - /// Looks up a localized string similar to Windows System Command. + /// Looks up a localized string similar to System Commands. /// public static string Microsoft_plugin_ext_system_page_name { get { @@ -213,6 +213,15 @@ namespace Microsoft.CmdPal.Ext.System { } } + /// + /// Looks up a localized string similar to Windows System Commands. + /// + public static string Microsoft_plugin_ext_system_page_title { + get { + return ResourceManager.GetString("Microsoft_plugin_ext_system_page_title", resourceCulture); + } + } + /// /// Looks up a localized string similar to Adapter name. /// diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.resx b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.resx index 0aaa3d0611..23d27a86a2 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.resx +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.resx @@ -160,8 +160,11 @@ Hide disconnected network info + + Windows System Commands + - Windows System Command + System Commands Adapter name diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/SystemCommandExtensionProvider.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/SystemCommandExtensionProvider.cs index b1dc3ffc26..54ec578dfa 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/SystemCommandExtensionProvider.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/SystemCommandExtensionProvider.cs @@ -14,7 +14,7 @@ public partial class SystemCommandExtensionProvider : CommandProvider private readonly ICommandItem[] _commands; private static readonly SettingsManager _settingsManager = new(); public static readonly SystemCommandPage Page = new(_settingsManager); - private readonly FallbackSystemCommandItem _fallbackFileItem = new(_settingsManager); + private readonly FallbackSystemCommandItem _fallbackSystemItem = new(_settingsManager); public SystemCommandExtensionProvider() { @@ -23,7 +23,7 @@ public partial class SystemCommandExtensionProvider : CommandProvider _commands = [ new CommandItem(Page) { - Title = Resources.Microsoft_plugin_ext_system_page_name, + Title = Resources.Microsoft_plugin_ext_system_page_title, Icon = Page.Icon, MoreCommands = [new CommandContextItem(_settingsManager.Settings.SettingsPage)], }, @@ -38,5 +38,5 @@ public partial class SystemCommandExtensionProvider : CommandProvider return _commands; } - public override IFallbackCommandItem[] FallbackCommands() => [_fallbackFileItem]; + public override IFallbackCommandItem[] FallbackCommands() => [_fallbackSystemItem]; }