From e6d4cde45f302f74df6b1e6ebc53e2d676aa5308 Mon Sep 17 00:00:00 2001 From: Clint Rutkas Date: Thu, 5 Sep 2024 15:54:04 -0700 Subject: [PATCH] lotta baseline adjustments --- .../Action.cs | 6 +- .../ActionResult.cs | 37 ++++++--- .../BaseObservable.cs | 8 +- .../ClipboardHelper.cs | 5 +- .../CommandContextItem.cs | 6 +- .../Details.cs | 6 +- .../DetailsElement.cs | 9 ++- .../DetailsLink.cs | 6 +- .../DetailsTags.cs | 6 +- .../DynamicListPage.cs | 6 +- .../ExtensionInstanceManager.cs | 5 +- .../ExtensionServer.cs | 5 +- .../Filter.cs | 6 +- .../Form.cs | 6 +- .../FormPage.cs | 18 ++++- .../GoToPageArgs.cs | 6 +- .../InvokableCommand.cs | 6 +- .../ListHelpers.cs | 5 +- .../ListItem.cs | 8 +- .../ListPage.cs | 77 ++++++++++++++++--- .../ListSection.cs | 6 +- .../MarkdownPage.cs | 6 +- .../SearchPrecisionScore.cs | 4 - .../StringMatcher.cs | 4 - .../Tag.cs | 70 ++++++++++++++--- 25 files changed, 259 insertions(+), 68 deletions(-) diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Action.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Action.cs index b0dafd8ba3..8e21dd7c64 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Action.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Action.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class Action : BaseObservable, ICommand { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ActionResult.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ActionResult.cs index 1835c201d3..996db8f749 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ActionResult.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ActionResult.cs @@ -1,20 +1,39 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class ActionResult : ICommandResult { - private ICommandResultArgs _Args = null; - private CommandResultKind _Kind = CommandResultKind.Dismiss; - public ICommandResultArgs Args => _Args; - public CommandResultKind Kind => _Kind; - public static ActionResult Dismiss() { - return new ActionResult() { _Kind = CommandResultKind.Dismiss }; + private ICommandResultArgs _args; + + private CommandResultKind _kind = CommandResultKind.Dismiss; + + public ICommandResultArgs Args => _args; + + public CommandResultKind Kind => _kind; + + public static ActionResult Dismiss() + { + return new ActionResult() + { + _kind = CommandResultKind.Dismiss + }; } + public static ActionResult GoHome() { - return new ActionResult() { _Kind = CommandResultKind.GoHome }; + return new ActionResult() + { + _kind = CommandResultKind.GoHome + }; } public static ActionResult KeepOpen() { - return new ActionResult() { _Kind = CommandResultKind.KeepOpen }; + return new ActionResult() + { + _kind = CommandResultKind.KeepOpen + }; } } diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/BaseObservable.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/BaseObservable.cs index f7aa03e85e..dad47eef06 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/BaseObservable.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/BaseObservable.cs @@ -1,3 +1,7 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + using Windows.Foundation; namespace Microsoft.CmdPal.Extensions.Helpers; @@ -11,6 +15,8 @@ public class BaseObservable : INotifyPropChanged protected void OnPropertyChanged(string propertyName) { if (PropChanged != null) - PropChanged.Invoke(this, new Microsoft.CmdPal.Extensions.PropChangedEventArgs(propertyName)); + { + PropChanged.Invoke(this, new PropChangedEventArgs(propertyName)); + } } } diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ClipboardHelper.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ClipboardHelper.cs index 8cf6f4b7cf..ab1a7fc0c7 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ClipboardHelper.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ClipboardHelper.cs @@ -1,5 +1,6 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System; using System.Diagnostics; diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/CommandContextItem.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/CommandContextItem.cs index fa28e6c69f..b084fc7521 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/CommandContextItem.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/CommandContextItem.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class CommandContextItem : ICommandContextItem { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Details.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Details.cs index d1ce6ea65b..4e2215540e 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Details.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Details.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class Details : BaseObservable, IDetails { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DetailsElement.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DetailsElement.cs index eeb56e1f7c..f8b158ba2c 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DetailsElement.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DetailsElement.cs @@ -1,7 +1,12 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class DetailsElement : IDetailsElement { - public string Key { get; set; } + public string Key { get; set; } = string.Empty; + public IDetailsData? Data { get; set; } } diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DetailsLink.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DetailsLink.cs index c4e2911749..8daf9677f3 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DetailsLink.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DetailsLink.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class DetailsLink : IDetailsLink { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DetailsTags.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DetailsTags.cs index c6521ca984..1f6905dedb 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DetailsTags.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DetailsTags.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class DetailsTags : IDetailsTags { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DynamicListPage.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DynamicListPage.cs index 0e210e4b9e..01cac09519 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DynamicListPage.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/DynamicListPage.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class DynamicListPage : ListPage, IDynamicListPage { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ExtensionInstanceManager.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ExtensionInstanceManager.cs index 53b5fedc59..ec76bd58d9 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ExtensionInstanceManager.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ExtensionInstanceManager.cs @@ -1,5 +1,6 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Runtime.InteropServices; using Windows.Win32; diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ExtensionServer.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ExtensionServer.cs index 1c9a9e9bc8..f9eeaa8fb9 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ExtensionServer.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ExtensionServer.cs @@ -1,5 +1,6 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Diagnostics; using System.Runtime.InteropServices; diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Filter.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Filter.cs index 72eb1b0ce8..5493655651 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Filter.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Filter.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class Filter : IFilter { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Form.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Form.cs index cfc8b9549a..b6bf5fa97a 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Form.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Form.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class Form: IForm { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/FormPage.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/FormPage.cs index e9b5e35cb9..e026132724 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/FormPage.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/FormPage.cs @@ -1,10 +1,22 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class FormPage : Action, IFormPage { - private bool _Loading = false; + private bool _loading; - public bool Loading { get => _Loading; set { _Loading = value; OnPropertyChanged(nameof(Loading)); } } + public bool Loading + { + get => _loading; + set + { + _loading = value; + OnPropertyChanged(nameof(Loading)); + } + } public virtual IForm[] Forms() => throw new NotImplementedException(); } diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/GoToPageArgs.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/GoToPageArgs.cs index 794bbecf5e..99ecf5cb49 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/GoToPageArgs.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/GoToPageArgs.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class GoToPageArgs : IGoToPageArgs { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/InvokableCommand.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/InvokableCommand.cs index 546f0298b0..79a222b70d 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/InvokableCommand.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/InvokableCommand.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class InvokableCommand : Action, IInvokableCommand { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListHelpers.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListHelpers.cs index 0a510d83a8..fc0270931b 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListHelpers.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListHelpers.cs @@ -1,5 +1,6 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Collections.ObjectModel; diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListItem.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListItem.cs index 41e32d3aa5..b574ea4fa1 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListItem.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListItem.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class ListItem : BaseObservable, IListItem { @@ -26,7 +30,7 @@ public class ListItem : BaseObservable, IListItem public ICommand Command { get => _command; set { _command = value; OnPropertyChanged(nameof(Command)); } } public IContextItem[] MoreCommands { get => _moreCommands; set { _moreCommands = value; OnPropertyChanged(nameof(MoreCommands)); } } - public IFallbackHandler? FallbackHandler { get => _fallbackHandler ?? _command as IFallbackHandler; init { _fallbackHandler = value; } } + public IFallbackHandler? FallbackHandler { get => _fallbackHandler ?? _command as IFallbackHandler; init => _fallbackHandler = value; } public ListItem(ICommand command) { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListPage.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListPage.cs index f66350b5da..86ee1f0a30 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListPage.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListPage.cs @@ -2,19 +2,72 @@ public class ListPage : Action, IListPage { - private string _PlaceholderText = ""; - private string _SearchText = ""; - private bool _ShowDetails = false; - private bool _Loading = false; - private IFilters _Filters = null; - private IGridProperties _GridProperties = null; + private string _placeholderText = string.Empty; + private string _searchText = string.Empty; + private bool _showDetails; + private bool _loading; + private IFilters _filters; + private IGridProperties _gridProperties; - public string PlaceholderText { get => _PlaceholderText; set { _PlaceholderText = value; OnPropertyChanged(nameof(PlaceholderText)); } } - public string SearchText { get => _SearchText; set { _SearchText = value; OnPropertyChanged(nameof(SearchText)); } } - public bool ShowDetails { get => _ShowDetails; set { _ShowDetails = value; OnPropertyChanged(nameof(ShowDetails)); } } - public bool Loading { get => _Loading; set { _Loading = value; OnPropertyChanged(nameof(Loading)); } } - public IFilters Filters { get => _Filters; set { _Filters = value; OnPropertyChanged(nameof(Filters)); } } - public IGridProperties GridProperties { get => _GridProperties; set { _GridProperties = value; OnPropertyChanged(nameof(GridProperties)); } } + public string PlaceholderText + { + get => _placeholderText; + set + { + _placeholderText = value; + OnPropertyChanged(nameof(PlaceholderText)); + } + } + + public string SearchText + { + get => _searchText; + set + { + _searchText = value; + OnPropertyChanged(nameof(SearchText)); + } + } + + public bool ShowDetails + { + get => _showDetails; + set + { + _showDetails = value; + OnPropertyChanged(nameof(ShowDetails)); + } + } + + public bool Loading + { + get => _loading; + set + { + _loading = value; + OnPropertyChanged(nameof(Loading)); + } + } + + public IFilters Filters + { + get => _filters; + set + { + _filters = value; + OnPropertyChanged(nameof(Filters)); + } + } + + public IGridProperties GridProperties + { + get => _gridProperties; + set + { + _gridProperties = value; + OnPropertyChanged(nameof(GridProperties)); + } + } public virtual ISection[] GetItems() => throw new NotImplementedException(); } diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListSection.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListSection.cs index 90d1d6b725..8efb54a1b6 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListSection.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/ListSection.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class ListSection : ISection { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/MarkdownPage.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/MarkdownPage.cs index 650fee350e..bb8a7a9a1f 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/MarkdownPage.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/MarkdownPage.cs @@ -1,4 +1,8 @@ -namespace Microsoft.CmdPal.Extensions.Helpers; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Extensions.Helpers; public class MarkdownPage : Action, IMarkdownPage { diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/SearchPrecisionScore.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/SearchPrecisionScore.cs index 012e4e7f6f..eca58cf64e 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/SearchPrecisionScore.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/SearchPrecisionScore.cs @@ -2,10 +2,6 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -//[assembly: InternalsVisibleTo("Microsoft.Plugin.Program.UnitTests")] -//[assembly: InternalsVisibleTo("Microsoft.PowerToys.Run.Plugin.System.UnitTests")] -//[assembly: InternalsVisibleTo("Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests")] - namespace Microsoft.CmdPal.Extensions.Helpers; public enum SearchPrecisionScore diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/StringMatcher.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/StringMatcher.cs index 3241542697..c5e9387660 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/StringMatcher.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/StringMatcher.cs @@ -4,10 +4,6 @@ using System.Globalization; -//[assembly: InternalsVisibleTo("Microsoft.Plugin.Program.UnitTests")] -//[assembly: InternalsVisibleTo("Microsoft.PowerToys.Run.Plugin.System.UnitTests")] -//[assembly: InternalsVisibleTo("Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests")] - namespace Microsoft.CmdPal.Extensions.Helpers; public class StringMatcher diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Tag.cs b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Tag.cs index e609e6f614..7a98c64860 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Tag.cs +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CmdPal.Extensions.Helpers/Tag.cs @@ -1,19 +1,67 @@ -using Windows.UI; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Windows.UI; namespace Microsoft.CmdPal.Extensions.Helpers; public class Tag : BaseObservable, ITag { - protected Color _Color = new(); - protected IconDataType _Icon = null; - protected string _Text = ""; - protected string _ToolTip = ""; - protected ICommand _Action; + private Color _color; + private IconDataType _icon = new(string.Empty); + private string _text = string.Empty; + private string _ToolTip = string.Empty; + private ICommand _command; - public Color Color { get => _Color; set { _Color = value; OnPropertyChanged(nameof(Color)); } } - public IconDataType Icon { get => _Icon; set { _Icon = value; OnPropertyChanged(nameof(Icon)); } } - public string Text { get => _Text; set { _Text = value; OnPropertyChanged(nameof(Text)); } } - public string ToolTip { get => _ToolTip; set { _ToolTip = value; OnPropertyChanged(nameof(ToolTip)); } } - public ICommand Command { get => _Action; set { _Action = value; OnPropertyChanged(nameof(Action)); } } + public Color Color + { + get => _color; + set + { + _color = value; + OnPropertyChanged(nameof(Color)); + } + } + + public IconDataType Icon + { + get => _icon; + set + { + _icon = value; + OnPropertyChanged(nameof(Icon)); + } + } + + public string Text + { + get => _text; + set + { + _text = value; + OnPropertyChanged(nameof(Text)); + } + } + + public string ToolTip + { + get => _ToolTip; + set + { + _ToolTip = value; + OnPropertyChanged(nameof(ToolTip)); + } + } + + public ICommand Command + { + get => _command; + set + { + _command = value; + OnPropertyChanged(nameof(Action)); + } + } }