A Swiss Army knife for developers.
C# blazorcross-platformcsharpdesktopdesktop-appdesktop-applicationdeveloper-toolsextensiblefluentfluent-designlinuxmacosmicasyntax-highlightingtypescriptwindowswindows-10windows-11winui
Improved text editor API, fixed bug in Smart Detection, fixed bug in Menu
Etienne Baudoux7402ae9fe7fd
diff --git a/src/app/dev/DevToys.Api/Core/LoggingExtensions.cs b/src/app/dev/DevToys.Api/Core/LoggingExtensions.csindex 2a359268e..9c36dda35 100644--- a/src/app/dev/DevToys.Api/Core/LoggingExtensions.cs+++ b/src/app/dev/DevToys.Api/Core/LoggingExtensions.cs@@ -11,7 +11,7 @@ public static class LoggingExtensions/// </summary>public static ILoggerFactory LoggerFactory{- private get => _loggerFactory;+ internal get => _loggerFactory;set{Guard.IsNull(_loggerFactory);diff --git a/src/app/dev/DevToys.Api/Tool/GUI/Components/IUIMultiLineTextInput.cs b/src/app/dev/DevToys.Api/Tool/GUI/Components/IUIMultiLineTextInput.csindex 2378b83b3..3d81cfcc3 100644--- a/src/app/dev/DevToys.Api/Tool/GUI/Components/IUIMultiLineTextInput.cs+++ b/src/app/dev/DevToys.Api/Tool/GUI/Components/IUIMultiLineTextInput.cs@@ -16,10 +16,15 @@ public interface IUIMultiLineTextInput : IUISingleLineTextInputstring SyntaxColorizationLanguageName { get; }/// <summary>- /// Gets whether the element can be expanded to take the size of the whole tool boundaries.+ /// Gets whether the element can be expanded to take the size of the whole tool boundaries. Default is false./// </summary>bool IsExtendableToFullScreen { get; }+ /// <summary>+ /// Gets how the text should wrap when it reached the maximum horizontal space it can take. Default is <see cref="UITextWrapMode.Auto"/>.+ /// </summary>+ UITextWrapMode WrapMode { get; }+/// <summary>/// Raised when <see cref="HighlightedSpans"/> is changed./// </summary>@@ -34,6 +39,11 @@ public interface IUIMultiLineTextInput : IUISingleLineTextInput/// Raised when <see cref="IsExtendableToFullScreen"/> is changed./// </summary>event EventHandler? IsExtendableToFullScreenChanged;++ /// <summary>+ /// Raised when <see cref="WrapMode"/> is changed.+ /// </summary>+ event EventHandler? WrapModeChanged;}[DebuggerDisplay($"Id = {{{nameof(Id)}}}, Text = {{{nameof(Text)}}}, SyntaxColorizationLanguageName = {{{nameof(SyntaxColorizationLanguageName)}}}")]@@ -42,6 +52,7 @@ internal class UIMultilineTextInput : UISingleLineTextInput, IUIMultiLineTextInpprivate IReadOnlyList<TextSpan>? _highlightedSpans;private string? _syntaxColorizationLanguageName;private bool _isExtendableToFullScreen;+ private UITextWrapMode _wrapMode = UITextWrapMode.Auto;internal UIMultilineTextInput(string? id): base(id)@@ -66,9 +77,16 @@ internal class UIMultilineTextInput : UISingleLineTextInput, IUIMultiLineTextInpinternal set => SetPropertyValue(ref _isExtendableToFullScreen, value, IsExtendableToFullScreenChanged);}+ public UITextWrapMode WrapMode+ {+ get => _wrapMode;+ internal set => SetPropertyValue(ref _wrapMode, value, WrapModeChanged);+ }+public event EventHandler? HighlightedSpansChanged;public event EventHandler? SyntaxColorizationLanguageNameChanged;public event EventHandler? IsExtendableToFullScreenChanged;+ public event EventHandler? WrapModeChanged;}public static partial class GUI@@ -144,4 +162,31 @@ public static partial class GUI((UIMultilineTextInput)element).IsExtendableToFullScreen = false;return element;}++ /// <summary>+ /// Indicates that the text in the editor will wrap automatically according to the user's settings.+ /// </summary>+ public static IUIMultiLineTextInput AutoWrap(this IUIMultiLineTextInput element)+ {+ ((UIMultilineTextInput)element).WrapMode = UITextWrapMode.Auto;+ return element;+ }++ /// <summary>+ /// Indicates that the text in the editor will always wrap when it reaches the border of the editor.+ /// </summary>+ public static IUIMultiLineTextInput AlwaysWrap(this IUIMultiLineTextInput element)+ {+ ((UIMultilineTextInput)element).WrapMode = UITextWrapMode.Wrap;+ return element;+ }++ /// <summary>+ /// Indicates that the text in the editor will never wrap when it reaches the border of the editor.+ /// </summary>+ public static IUIMultiLineTextInput NeverWrap(this IUIMultiLineTextInput element)+ {+ ((UIMultilineTextInput)element).WrapMode = UITextWrapMode.NoWrap;+ return element;+ }}diff --git a/src/app/dev/DevToys.Api/Tool/GUI/Components/IUISinglelineTextInput.cs b/src/app/dev/DevToys.Api/Tool/GUI/Components/IUISinglelineTextInput.csindex 76f4979cd..8e0c3d72d 100644--- a/src/app/dev/DevToys.Api/Tool/GUI/Components/IUISinglelineTextInput.cs+++ b/src/app/dev/DevToys.Api/Tool/GUI/Components/IUISinglelineTextInput.cs@@ -73,7 +73,11 @@ internal class UISingleLineTextInput : UITitledElement, IUISingleLineTextInputpublic string Text{get => _text ?? string.Empty;- internal set => SetPropertyValue(ref _text, value, TextChanged);+ internal set+ {+ SetPropertyValue(ref _text, value, TextChanged);+ ActionOnTextChanged?.Invoke(_text ?? string.Empty);+ }}public bool IsReadOnly@@ -120,6 +124,8 @@ internal class UISingleLineTextInput : UITitledElement, IUISingleLineTextInputinternal set => SetPropertyValue(ref _commandBarExtraContent, value, CommandBarExtraContentChanged);}+ internal Func<string, ValueTask>? ActionOnTextChanged { get; set; }+public event EventHandler? TextChanged;public event EventHandler? IsReadOnlyChanged;public event EventHandler? CanCopyWhenEditableChanged;@@ -241,4 +247,35 @@ public static partial class GUI}return element;}++ /// <summary>+ /// Sets the action to run when the text changed.+ /// </summary>+ public static T OnTextChanged<T>(this T element, Func<string, ValueTask> actionOnTextChanged) where T : IUISingleLineTextInput+ {+ if (element is UISingleLineTextInput strongElement)+ {+ strongElement.ActionOnTextChanged = actionOnTextChanged;+ }++ return element;+ }++ /// <summary>+ /// Sets the action to run when the text changed.+ /// </summary>+ public static T OnTextChanged<T>(this T element, Action<string> actionOnTextChanged) where T : IUISingleLineTextInput+ {+ if (element is UISingleLineTextInput strongElement)+ {+ strongElement.ActionOnTextChanged+ = (value) =>+ {+ actionOnTextChanged?.Invoke(value);+ return ValueTask.CompletedTask;+ };+ }++ return element;+ }}diff --git a/src/app/dev/DevToys.Api/Tool/GUI/Components/UITextWrapMode.cs b/src/app/dev/DevToys.Api/Tool/GUI/Components/UITextWrapMode.csnew file mode 100644index 000000000..e9e5c0bca--- /dev/null+++ b/src/app/dev/DevToys.Api/Tool/GUI/Components/UITextWrapMode.cs@@ -0,0 +1,22 @@+namespace DevToys.Api;++/// <summary>+/// Describes how a text in an element should wrap when it reached the maximum horizontal space it can take.+/// </summary>+public enum UITextWrapMode+{+ /// <summary>+ /// Wrap automatically or not depending on the user's settings.+ /// </summary>+ Auto,++ /// <summary>+ /// Wrap the text to a new line.+ /// </summary>+ Wrap,++ /// <summary>+ /// Do not wrap the text to a new line.+ /// </summary>+ NoWrap+}diff --git a/src/app/dev/DevToys.Api/Tool/GUI/PredefinedCommonToolGroupNames.cs b/src/app/dev/DevToys.Api/Tool/GUI/PredefinedCommonToolGroupNames.csnew file mode 100644index 000000000..e70a64000--- /dev/null+++ b/src/app/dev/DevToys.Api/Tool/GUI/PredefinedCommonToolGroupNames.cs@@ -0,0 +1,6 @@+namespace DevToys.Api;++public static class PredefinedCommonToolGroupNames+{+ public const string EncodersDecoders = "Encoders / Decoders";+}diff --git a/src/app/dev/DevToys.Blazor/BuiltInTools/ExtensionsManager/ExtensionsManagerGuiTool.cs b/src/app/dev/DevToys.Blazor/BuiltInTools/ExtensionsManager/ExtensionsManagerGuiTool.csindex ff62a0eb1..e8fb899f3 100644--- a/src/app/dev/DevToys.Blazor/BuiltInTools/ExtensionsManager/ExtensionsManagerGuiTool.cs+++ b/src/app/dev/DevToys.Blazor/BuiltInTools/ExtensionsManager/ExtensionsManagerGuiTool.cs@@ -1,6 +1,5 @@using System.Collections.Immutable;using DevToys.Blazor.BuiltInTools.Settings;-using Newtonsoft.Json;using NuGet.Packaging;using NuGet.Packaging.Core;@@ -21,6 +20,9 @@ namespace DevToys.Blazor.BuiltInTools.ExtensionsManager;[NotSearchable][NoCompactOverlaySupport][Order(Before = SettingsGuiTool.SettingsInternalToolName)]+[TargetPlatform(Platform.Windows)]+[TargetPlatform(Platform.Linux)]+[TargetPlatform(Platform.MacCatalyst)]internal sealed class ExtensionsManagerGuiTool : IGuiTool{private enum GridRowsdiff --git a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditor.razor.cs b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditor.razor.csindex 885463617..0cd1b1e3d 100644--- a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditor.razor.cs+++ b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditor.razor.cs@@ -39,6 +39,9 @@ public partial class MonacoEditor : RicherMonacoEditorBase[Parameter]public Func<MonacoEditor, StandaloneEditorConstructionOptions>? ConstructionOptions { get; set; }+ [Parameter]+ public UITextWrapMode? WrapMode { get; set; }+private bool ShowLoading { get; set; }protected override void OnInitialized()@@ -50,6 +53,16 @@ public partial class MonacoEditor : RicherMonacoEditorBase_oldIsActuallyEnabled = IsActuallyEnabled;}+ protected override void OnParametersSet()+ {+ base.OnParametersSet();++ if (_settingsProvider is not null)+ {+ SettingsProvider_SettingChanged(_settingsProvider, null!);+ }+ }+protected override async Task OnAfterRenderAsync(bool firstRender){if (firstRender)@@ -80,10 +93,10 @@ public partial class MonacoEditor : RicherMonacoEditorBase// Apply global user settingsoptions.FontFamily = _settingsProvider.GetSetting(PredefinedSettings.TextEditorFont);- options.WordWrap = _settingsProvider.GetSetting(PredefinedSettings.TextEditorTextWrapping) ? "on" : "off";options.LineNumbers = _settingsProvider.GetSetting(PredefinedSettings.TextEditorLineNumbers) ? "on" : "off";options.RenderLineHighlight = _settingsProvider.GetSetting(PredefinedSettings.TextEditorHighlightCurrentLine) ? "all" : "none";options.RenderWhitespace = _settingsProvider.GetSetting(PredefinedSettings.TextEditorRenderWhitespace) ? "all" : "none";+ ApplyWordWrapOption(options);// Create the editorawait MonacoEditorHelper.CreateMonacoEditorInstanceAsync(JSRuntime, Id, options, null, Reference);@@ -142,12 +155,13 @@ public partial class MonacoEditor : RicherMonacoEditorBasevar options = new EditorUpdateOptions(){FontFamily = _settingsProvider.GetSetting(PredefinedSettings.TextEditorFont),- WordWrap = _settingsProvider.GetSetting(PredefinedSettings.TextEditorTextWrapping) ? "on" : "off",LineNumbers = _settingsProvider.GetSetting(PredefinedSettings.TextEditorLineNumbers) ? "on" : "off",RenderLineHighlight = _settingsProvider.GetSetting(PredefinedSettings.TextEditorHighlightCurrentLine) ? "all" : "none",RenderWhitespace = _settingsProvider.GetSetting(PredefinedSettings.TextEditorRenderWhitespace) ? "all" : "none"};+ ApplyWordWrapOption(options);+UpdateOptionsAsync(options);}@@ -187,4 +201,22 @@ public partial class MonacoEditor : RicherMonacoEditorBase}}}++ private void ApplyWordWrapOption(EditorOptions editorOptions)+ {+ switch (WrapMode)+ {+ case UITextWrapMode.Auto:+ editorOptions.WordWrap = _settingsProvider.GetSetting(PredefinedSettings.TextEditorTextWrapping) ? "on" : "off";+ break;+ case UITextWrapMode.Wrap:+ editorOptions.WordWrap = "on";+ break;+ case UITextWrapMode.NoWrap:+ editorOptions.WordWrap = "off";+ break;+ default:+ throw new NotSupportedException();+ }+ }}diff --git a/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor b/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razorindex 6d1368809..089808945 100644--- a/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor+++ b/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor@@ -10,8 +10,9 @@HorizontalAlignment="@UIMultiLineTextInput.HorizontalAlignment"IsVisible="@UIMultiLineTextInput.IsVisible"IsEnabled="@(UIMultiLineTextInput.IsEnabled && IsActuallyEnabled)"+ WrapMode="@UIMultiLineTextInput.WrapMode"ConstructionOptions="@OnMonacoConstructionOptions"OnDidChangeModelContent="OnMonacoEditorTextChangedAsync"OnDidInit="OnMonacoEditorInitializedAsync"- ParentComponent="_textInputWrapper" />+ ParentComponent="_textInputWrapper"/></UITextInputWrapper>\ No newline at end of filediff --git a/src/app/dev/DevToys.Business/ViewModels/MainWindowViewModel.cs b/src/app/dev/DevToys.Business/ViewModels/MainWindowViewModel.csindex 35f3ec53e..3753cbff9 100644--- a/src/app/dev/DevToys.Business/ViewModels/MainWindowViewModel.cs+++ b/src/app/dev/DevToys.Business/ViewModels/MainWindowViewModel.cs@@ -257,6 +257,8 @@ internal sealed partial class MainWindowViewModel : ObservableRecipient{// Then let's navigate immediately to it and set the detected data as an input.SelectedMenuItem = firstToolViewItem;+ _ = detectedTools[0].ToolInstance.View; // Do nothing with the view but trigger to instance because `PassSmartDetectedData` may assume the UI is instantiated.+ // Send the data to the tool.detectedTools[0].ToolInstance.PassSmartDetectedData(detectedTools[0].DataTypeName, detectedTools[0].ParsedData);}else if (detectedTools.Count > 1)diff --git a/src/app/dev/DevToys.Core/Tools/GuiToolProvider.cs b/src/app/dev/DevToys.Core/Tools/GuiToolProvider.csindex fd48accdc..c6090b505 100644--- a/src/app/dev/DevToys.Core/Tools/GuiToolProvider.cs+++ b/src/app/dev/DevToys.Core/Tools/GuiToolProvider.cs@@ -568,7 +568,7 @@ public sealed partial class GuiToolProvider// Add the tool to the group.Guard.IsNotNull(groupViewItem.Value.Children);- groupViewItem.Value.Children.Add(new GuiToolViewItem(tool));+ groupViewItem.Value.Children.Add(new GuiToolViewItem(tool, showLongDisplayTitle: false));}// Order tools groups.diff --git a/src/app/dev/DevToys.Tools/DevToys.Tools.csproj b/src/app/dev/DevToys.Tools/DevToys.Tools.csprojindex be3a159d1..91466277b 100644--- a/src/app/dev/DevToys.Tools/DevToys.Tools.csproj+++ b/src/app/dev/DevToys.Tools/DevToys.Tools.csproj@@ -29,10 +29,15 @@--></ItemGroup><ItemGroup>- <Compile Update="Tools\Sample\Sample.Designer.cs">+ <Compile Update="Tools\EncodersDecoders\Base64Text\Base64TextEncoderDecoder.Designer.cs"><DesignTime>True</DesignTime><AutoGen>True</AutoGen>- <DependentUpon>Sample.resx</DependentUpon>+ <DependentUpon>Base64TextEncoderDecoder.resx</DependentUpon>+ </Compile>+ <Compile Update="Tools\EncodersDecoders\EncodersDecoders.Designer.cs">+ <DesignTime>True</DesignTime>+ <AutoGen>True</AutoGen>+ <DependentUpon>EncodersDecoders.resx</DependentUpon></Compile><Compile Update="Tools\Test\Test.Designer.cs"><DependentUpon>Test.resx</DependentUpon>@@ -41,9 +46,13 @@</Compile></ItemGroup><ItemGroup>- <EmbeddedResource Update="Tools\Sample\Sample.resx">+ <EmbeddedResource Update="Tools\EncodersDecoders\Base64Text\Base64TextEncoderDecoder.resx"><Generator>ResXFileCodeGenerator</Generator>- <LastGenOutput>Sample.Designer.cs</LastGenOutput>+ <LastGenOutput>Base64TextEncoderDecoder.Designer.cs</LastGenOutput>+ </EmbeddedResource>+ <EmbeddedResource Update="Tools\EncodersDecoders\EncodersDecoders.resx">+ <Generator>ResXFileCodeGenerator</Generator>+ <LastGenOutput>EncodersDecoders.Designer.cs</LastGenOutput></EmbeddedResource><EmbeddedResource Update="Tools\Test\Test.resx"><LastGenOutput>Test.Designer.cs</LastGenOutput>@@ -51,16 +60,15 @@</EmbeddedResource></ItemGroup>+ <ItemGroup>+ <EmbeddedResource Include="..\..\..\..\assets\font\DevToys-Tools-Icons.ttf" Link="Assets\fonts\DevToys-Tools-Icons.ttf" />+ </ItemGroup>+<ItemGroup><PackageReference Include="System.Text.Json" /></ItemGroup><Target Name="CopyPluginAfterBuild" AfterTargets="Pack">- <Copy SourceFiles="$(PackageOutputPath)\$(PackageId).$(PackageVersion).nupkg"- DestinationFolder="$(PluginNupkgPath)"- SkipUnchangedFiles="false"- OverwriteReadOnlyFiles="true"- Retries="10"- RetryDelayMilliseconds="1000" />+ <Copy SourceFiles="$(PackageOutputPath)\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$(PluginNupkgPath)" SkipUnchangedFiles="false" OverwriteReadOnlyFiles="true" Retries="10" RetryDelayMilliseconds="1000" /></Target></Project>\ No newline at end of filediff --git a/src/app/dev/DevToys.Tools/DevToysToolsResourceManagerAssemblyIdentifier.cs b/src/app/dev/DevToys.Tools/DevToysToolsResourceManagerAssemblyIdentifier.csindex 15a9fa60a..555344b90 100644--- a/src/app/dev/DevToys.Tools/DevToysToolsResourceManagerAssemblyIdentifier.cs+++ b/src/app/dev/DevToys.Tools/DevToysToolsResourceManagerAssemblyIdentifier.cs@@ -1,4 +1,6 @@-namespace DevToys.Tools;+using System.Reflection;++namespace DevToys.Tools;[Export(typeof(IResourceAssemblyIdentifier))][Name(nameof(DevToysToolsResourceManagerAssemblyIdentifier))]@@ -6,6 +8,13 @@ public sealed class DevToysToolsResourceManagerAssemblyIdentifier : IResourceAss{public ValueTask<FontDefinition[]> GetFontDefinitionsAsync(){- throw new NotImplementedException();+ var assembly = Assembly.GetExecutingAssembly();+ string resourceName = "DevToys.Tools.Assets.fonts.DevToys-Tools-Icons.ttf";++ Stream stream = assembly.GetManifestResourceStream(resourceName)!;+ return new ValueTask<FontDefinition[]>(new[]+ {+ new FontDefinition("DevToys-Tools-Icons", stream)+ });}}diff --git a/src/app/dev/DevToys.Tools/Tools/EncodersDecoders/EncodersDecoders.Designer.cs b/src/app/dev/DevToys.Tools/Tools/EncodersDecoders/EncodersDecoders.Designer.csnew file mode 100644index 000000000..c33c77d99--- /dev/null+++ b/src/app/dev/DevToys.Tools/Tools/EncodersDecoders/EncodersDecoders.Designer.cs@@ -0,0 +1,81 @@+//------------------------------------------------------------------------------+// <auto-generated>+// This code was generated by a tool.+// Runtime Version:4.0.30319.42000+//+// Changes to this file may cause incorrect behavior and will be lost if+// the code is regenerated.+// </auto-generated>+//------------------------------------------------------------------------------++namespace DevToys.Tools.Tools.EncodersDecoders {+ using System;+++ /// <summary>+ /// A strongly-typed resource class, for looking up localized strings, etc.+ /// </summary>+ // This class was auto-generated by the StronglyTypedResourceBuilder+ // class via a tool like ResGen or Visual Studio.+ // To add or remove a member, edit your .ResX file then rerun ResGen+ // with the /str option, or rebuild your VS project.+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]+ internal class EncodersDecoders {++ private static global::System.Resources.ResourceManager resourceMan;++ private static global::System.Globalization.CultureInfo resourceCulture;++ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]+ internal EncodersDecoders() {+ }++ /// <summary>+ /// Returns the cached ResourceManager instance used by this class.+ /// </summary>+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]+ internal static global::System.Resources.ResourceManager ResourceManager {+ get {+ if (object.ReferenceEquals(resourceMan, null)) {+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DevToys.Tools.Tools.EncodersDecoders.EncodersDecoders", typeof(EncodersDecoders).Assembly);+ resourceMan = temp;+ }+ return resourceMan;+ }+ }++ /// <summary>+ /// Overrides the current thread's CurrentUICulture property for all+ /// resource lookups using this strongly typed resource class.+ /// </summary>+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]+ internal static global::System.Globalization.CultureInfo Culture {+ get {+ return resourceCulture;+ }+ set {+ resourceCulture = value;+ }+ }++ /// <summary>+ /// Looks up a localized string similar to .+ /// </summary>+ internal static string AccessibleName {+ get {+ return ResourceManager.GetString("AccessibleName", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to Encoders / Decoders.+ /// </summary>+ internal static string DisplayTitle {+ get {+ return ResourceManager.GetString("DisplayTitle", resourceCulture);+ }+ }+ }+}diff --git a/src/app/dev/DevToys.Tools/Tools/EncodersDecoders/EncodersDecoders.resx b/src/app/dev/DevToys.Tools/Tools/EncodersDecoders/EncodersDecoders.resxnew file mode 100644index 000000000..36edfb868--- /dev/null+++ b/src/app/dev/DevToys.Tools/Tools/EncodersDecoders/EncodersDecoders.resx@@ -0,0 +1,126 @@+<?xml version="1.0" encoding="utf-8"?>+<root>+ <!--+ Microsoft ResX Schema++ Version 2.0++ The primary goals of this format is to allow a simple XML format+ that is mostly human readable. The generation and parsing of the+ various data types are done through the TypeConverter classes+ associated with the data types.++ Example:++ ... ado.net/XML headers & schema ...+ <resheader name="resmimetype">text/microsoft-resx</resheader>+ <resheader name="version">2.0</resheader>+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">+ <value>[base64 mime encoded serialized .NET Framework object]</value>+ </data>+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>+ <comment>This is a comment</comment>+ </data>++ There are any number of "resheader" rows that contain simple+ name/value pairs.++ Each data row contains a name, and value. The row also contains a+ type or mimetype. Type corresponds to a .NET class that support+ text/value conversion through the TypeConverter architecture.+ Classes that don't support this are serialized and stored with the+ mimetype set.++ The mimetype is used for serialized objects, and tells the+ ResXResourceReader how to depersist the object. This is currently not+ extensible. For a given mimetype the value must be set accordingly:++ Note - application/x-microsoft.net.object.binary.base64 is the format+ that the ResXResourceWriter will generate, however the reader can+ read any of the formats listed below.++ mimetype: application/x-microsoft.net.object.binary.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.soap.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.bytearray.base64+ value : The object must be serialized into a byte array+ : using a System.ComponentModel.TypeConverter+ : and then encoded with base64 encoding.+ -->+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />+ <xsd:element name="root" msdata:IsDataSet="true">+ <xsd:complexType>+ <xsd:choice maxOccurs="unbounded">+ <xsd:element name="metadata">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" />+ </xsd:sequence>+ <xsd:attribute name="name" use="required" type="xsd:string" />+ <xsd:attribute name="type" type="xsd:string" />+ <xsd:attribute name="mimetype" type="xsd:string" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="assembly">+ <xsd:complexType>+ <xsd:attribute name="alias" type="xsd:string" />+ <xsd:attribute name="name" type="xsd:string" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="data">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="resheader">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" />+ </xsd:complexType>+ </xsd:element>+ </xsd:choice>+ </xsd:complexType>+ </xsd:element>+ </xsd:schema>+ <resheader name="resmimetype">+ <value>text/microsoft-resx</value>+ </resheader>+ <resheader name="version">+ <value>2.0</value>+ </resheader>+ <resheader name="reader">+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <resheader name="writer">+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <data name="AccessibleName" xml:space="preserve">+ <value />+ </data>+ <data name="DisplayTitle" xml:space="preserve">+ <value>Encoders / Decoders</value>+ </data>+</root>\ No newline at end of filediff --git a/src/app/dev/DevToys.Tools/Tools/EncodersDecoders/EncodersDecodersGroup.cs b/src/app/dev/DevToys.Tools/Tools/EncodersDecoders/EncodersDecodersGroup.csnew file mode 100644index 000000000..569308f84--- /dev/null+++ b/src/app/dev/DevToys.Tools/Tools/EncodersDecoders/EncodersDecodersGroup.cs@@ -0,0 +1,15 @@+namespace DevToys.Tools.Tools.EncodersDecoders;++[Export(typeof(GuiToolGroup))]+[Name(PredefinedCommonToolGroupNames.EncodersDecoders)]+internal sealed class EncodersDecodersGroup : GuiToolGroup+{+ [ImportingConstructor]+ internal EncodersDecodersGroup()+ {+ IconFontName = "DevToys-Tools-Icons";+ IconGlyph = '\u0105';+ DisplayTitle = EncodersDecoders.DisplayTitle;+ AccessibleName = EncodersDecoders.AccessibleName;+ }+}diff --git a/src/app/dev/DevToys.Tools/Tools/Sample/SampleToolFactory.cs b/src/app/dev/DevToys.Tools/Tools/Sample/SampleToolFactory.csindex 84be3b3be..bfad1945d 100644--- a/src/app/dev/DevToys.Tools/Tools/Sample/SampleToolFactory.cs+++ b/src/app/dev/DevToys.Tools/Tools/Sample/SampleToolFactory.cs@@ -35,20 +35,6 @@ internal sealed class SampleCommandLineTool : ICommandLineTool}}-[Export(typeof(GuiToolGroup))]-[Name("Encoders / Decoders")]-internal sealed class EncodersDecodersGroup : GuiToolGroup-{- [ImportingConstructor]- internal EncodersDecodersGroup()- {- IconFontName = "FluentSystemIcons";- IconGlyph = '\uE670';- DisplayTitle = Sample.CommandDescription;- AccessibleName = Sample.CommandDescription;- }-}-[Export(typeof(IGuiTool))][Name("Sample tool")][ToolDisplayInformation(