A Swiss Army knife for developers.
C# blazorcross-platformcsharpdesktopdesktop-appdesktop-applicationdeveloper-toolsextensiblefluentfluent-designlinuxmacosmicasyntax-highlightingtypescriptwindowswindows-10windows-11winui
Added String Utilities tool. (#40)
Etienne Baudoux4d0f186b5ee8
diff --git a/README.md b/README.mdindex 16e89afaf..428303afa 100644--- a/README.md+++ b/README.md@@ -26,10 +26,12 @@ DevToys helps in everyday tasks like formatting JSON, comparing text, testing ReMany tools are available.- Base 64 Encoder/Decoder- Hash Generator (MD5, SHA1, SHA256, SHA512)+- JWT Decoder- Json Formatter- RegExp Tester- Text Comparer- Json <> Yaml converter+- String Utilities... and more are coming!@@ -68,6 +70,7 @@ Here is the list of tool name you can use:- `jsonyaml` - Json <> Yaml- `jwt` - JWT Decoder- `regex` - Regular Expression Tester+- `string` - String Utilities- `diff` - Text Comparer- `settings` - Settingsdiff --git a/src/dev/impl/DevToys/Core/Settings/PredefinedSettings.cs b/src/dev/impl/DevToys/Core/Settings/PredefinedSettings.csindex 1f03cf913..eb058fe93 100644--- a/src/dev/impl/DevToys/Core/Settings/PredefinedSettings.cs+++ b/src/dev/impl/DevToys/Core/Settings/PredefinedSettings.cs@@ -84,7 +84,7 @@ namespace DevToys.Core.Settingspublic static readonly SettingDefinition<string> TextEditorFont= new(name: nameof(TextEditorFont),- isRoaming: true,+ isRoaming: false,defaultValue: "Cascadia Mono");/// <summary>diff --git a/src/dev/impl/DevToys/DevToys.csproj b/src/dev/impl/DevToys/DevToys.csprojindex 5e46cf8f4..29184200a 100644--- a/src/dev/impl/DevToys/DevToys.csproj+++ b/src/dev/impl/DevToys/DevToys.csproj@@ -209,6 +209,8 @@<Compile Include="ViewModels\Tools\JsonYaml\JsonYamlToolViewModel.cs" /><Compile Include="ViewModels\Tools\JwtDecoderEncoder\JwtDecoderEncoderToolProvider.cs" /><Compile Include="ViewModels\Tools\JwtDecoderEncoder\JwtDecoderEncoderToolViewModel.cs" />+ <Compile Include="ViewModels\Tools\StringUtilities\StringUtilitiesToolProvider.cs" />+ <Compile Include="ViewModels\Tools\StringUtilities\StringUtilitiesToolViewModel.cs" /><Compile Include="ViewModels\Tools\ToolProviderBase.cs" /><Compile Include="Core\UriActivationProtocolService.cs" /><Compile Include="LanguageDefinition.cs" />@@ -288,6 +290,9 @@<Compile Include="Views\Tools\Settings\SettingsToolPage.xaml.cs"><DependentUpon>SettingsToolPage.xaml</DependentUpon></Compile>+ <Compile Include="Views\Tools\StringUtilities\StringUtilitiesToolPage.xaml.cs">+ <DependentUpon>StringUtilitiesToolPage.xaml</DependentUpon>+ </Compile><Compile Include="Views\Tools\TextDiff\TextDiffToolPage.xaml.cs"><DependentUpon>TextDiffToolPage.xaml</DependentUpon></Compile>@@ -383,6 +388,10 @@<Generator>MSBuild:Compile</Generator><SubType>Designer</SubType></Page>+ <Page Include="Views\Tools\StringUtilities\StringUtilitiesToolPage.xaml">+ <SubType>Designer</SubType>+ <Generator>MSBuild:Compile</Generator>+ </Page><Page Include="Views\Tools\TextDiff\TextDiffToolPage.xaml"><Generator>MSBuild:Compile</Generator><SubType>Designer</SubType>@@ -411,6 +420,7 @@<Name>DevToys.MonacoEditor</Name></ProjectReference></ItemGroup>+ <ItemGroup /><Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" /><!-- To modify your build process, add your task inside one of the targets below and uncomment it.Other similar extension points exist, see Microsoft.Common.targets.diff --git a/src/dev/impl/DevToys/LanguageManager.cs b/src/dev/impl/DevToys/LanguageManager.csindex eb274eb74..4117c10cf 100644--- a/src/dev/impl/DevToys/LanguageManager.cs+++ b/src/dev/impl/DevToys/LanguageManager.cs@@ -33,6 +33,7 @@ namespace DevToysprivate readonly MainPageStrings _mainpage = new MainPageStrings();private readonly RegExStrings _regex = new RegExStrings();private readonly SettingsStrings _settings = new SettingsStrings();+ private readonly StringUtilitiesStrings _stringutilities = new StringUtilitiesStrings();private readonly TextDiffStrings _textdiff = new TextDiffStrings();/// <summary>@@ -90,6 +91,11 @@ namespace DevToys/// </summary>public SettingsStrings Settings => _settings;+ /// <summary>+ /// Gets the <see cref="StringUtilitiesStrings"/>.+ /// </summary>+ public StringUtilitiesStrings StringUtilities => _stringutilities;+/// <summary>/// Gets the <see cref="TextDiffStrings"/>./// </summary>@@ -787,6 +793,161 @@ namespace DevToyspublic string WordWrap => _resources.GetString("WordWrap");}+ public class StringUtilitiesStrings : ObservableObject+ {+ private readonly ResourceLoader _resources = ResourceLoader.GetForViewIndependentUse("StringUtilities");++ /// <summary>+ /// Gets the resource AlternatingCase.+ /// </summary>+ public string AlternatingCase => _resources.GetString("AlternatingCase");++ /// <summary>+ /// Gets the resource Bytes.+ /// </summary>+ public string Bytes => _resources.GetString("Bytes");++ /// <summary>+ /// Gets the resource CamelCase.+ /// </summary>+ public string CamelCase => _resources.GetString("CamelCase");++ /// <summary>+ /// Gets the resource CharacterDistribution.+ /// </summary>+ public string CharacterDistribution => _resources.GetString("CharacterDistribution");++ /// <summary>+ /// Gets the resource Characters.+ /// </summary>+ public string Characters => _resources.GetString("Characters");++ /// <summary>+ /// Gets the resource CobolCase.+ /// </summary>+ public string CobolCase => _resources.GetString("CobolCase");++ /// <summary>+ /// Gets the resource Column.+ /// </summary>+ public string Column => _resources.GetString("Column");++ /// <summary>+ /// Gets the resource ConstantCase.+ /// </summary>+ public string ConstantCase => _resources.GetString("ConstantCase");++ /// <summary>+ /// Gets the resource Convert.+ /// </summary>+ public string Convert => _resources.GetString("Convert");++ /// <summary>+ /// Gets the resource DisplayName.+ /// </summary>+ public string DisplayName => _resources.GetString("DisplayName");++ /// <summary>+ /// Gets the resource InverseCase.+ /// </summary>+ public string InverseCase => _resources.GetString("InverseCase");++ /// <summary>+ /// Gets the resource KebabCase.+ /// </summary>+ public string KebabCase => _resources.GetString("KebabCase");++ /// <summary>+ /// Gets the resource Line.+ /// </summary>+ public string Line => _resources.GetString("Line");++ /// <summary>+ /// Gets the resource Lines.+ /// </summary>+ public string Lines => _resources.GetString("Lines");++ /// <summary>+ /// Gets the resource LowerCase.+ /// </summary>+ public string LowerCase => _resources.GetString("LowerCase");++ /// <summary>+ /// Gets the resource OriginalCase.+ /// </summary>+ public string OriginalCase => _resources.GetString("OriginalCase");++ /// <summary>+ /// Gets the resource Paragraphs.+ /// </summary>+ public string Paragraphs => _resources.GetString("Paragraphs");++ /// <summary>+ /// Gets the resource PascalCase.+ /// </summary>+ public string PascalCase => _resources.GetString("PascalCase");++ /// <summary>+ /// Gets the resource Position.+ /// </summary>+ public string Position => _resources.GetString("Position");++ /// <summary>+ /// Gets the resource Selection.+ /// </summary>+ public string Selection => _resources.GetString("Selection");++ /// <summary>+ /// Gets the resource SentenceCase.+ /// </summary>+ public string SentenceCase => _resources.GetString("SentenceCase");++ /// <summary>+ /// Gets the resource Sentences.+ /// </summary>+ public string Sentences => _resources.GetString("Sentences");++ /// <summary>+ /// Gets the resource SnakeCase.+ /// </summary>+ public string SnakeCase => _resources.GetString("SnakeCase");++ /// <summary>+ /// Gets the resource Statistics.+ /// </summary>+ public string Statistics => _resources.GetString("Statistics");++ /// <summary>+ /// Gets the resource String.+ /// </summary>+ public string String => _resources.GetString("String");++ /// <summary>+ /// Gets the resource TitleCase.+ /// </summary>+ public string TitleCase => _resources.GetString("TitleCase");++ /// <summary>+ /// Gets the resource TrainCase.+ /// </summary>+ public string TrainCase => _resources.GetString("TrainCase");++ /// <summary>+ /// Gets the resource UpperCase.+ /// </summary>+ public string UpperCase => _resources.GetString("UpperCase");++ /// <summary>+ /// Gets the resource WordDistribution.+ /// </summary>+ public string WordDistribution => _resources.GetString("WordDistribution");++ /// <summary>+ /// Gets the resource Words.+ /// </summary>+ public string Words => _resources.GetString("Words");+ }+public class TextDiffStrings : ObservableObject{private readonly ResourceLoader _resources = ResourceLoader.GetForViewIndependentUse("TextDiff");diff --git a/src/dev/impl/DevToys/Strings/en/StringUtilities.resw b/src/dev/impl/DevToys/Strings/en/StringUtilities.reswnew file mode 100644index 000000000..08c882244--- /dev/null+++ b/src/dev/impl/DevToys/Strings/en/StringUtilities.resw@@ -0,0 +1,210 @@+<?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="AlternatingCase" xml:space="preserve">+ <value>aLtErNaTiNg cAsE</value>+ </data>+ <data name="Bytes" xml:space="preserve">+ <value>Bytes:</value>+ </data>+ <data name="CamelCase" xml:space="preserve">+ <value>camelCase</value>+ </data>+ <data name="CharacterDistribution" xml:space="preserve">+ <value>Character distribution</value>+ </data>+ <data name="Characters" xml:space="preserve">+ <value>Characters:</value>+ </data>+ <data name="CobolCase" xml:space="preserve">+ <value>COBOL-CASE</value>+ </data>+ <data name="Column" xml:space="preserve">+ <value>Column:</value>+ </data>+ <data name="ConstantCase" xml:space="preserve">+ <value>CONSTANT_CASE</value>+ </data>+ <data name="Convert" xml:space="preserve">+ <value>Convert</value>+ </data>+ <data name="DisplayName" xml:space="preserve">+ <value>String Utilities</value>+ </data>+ <data name="InverseCase" xml:space="preserve">+ <value>InVeRsE CaSe</value>+ </data>+ <data name="KebabCase" xml:space="preserve">+ <value>kebab-case</value>+ </data>+ <data name="Line" xml:space="preserve">+ <value>Line:</value>+ </data>+ <data name="Lines" xml:space="preserve">+ <value>Lines:</value>+ </data>+ <data name="LowerCase" xml:space="preserve">+ <value>lower case</value>+ </data>+ <data name="OriginalCase" xml:space="preserve">+ <value>Original text</value>+ </data>+ <data name="Paragraphs" xml:space="preserve">+ <value>Paragraphs:</value>+ </data>+ <data name="PascalCase" xml:space="preserve">+ <value>PascalCase</value>+ </data>+ <data name="Position" xml:space="preserve">+ <value>Position:</value>+ </data>+ <data name="Selection" xml:space="preserve">+ <value>Selection</value>+ </data>+ <data name="SentenceCase" xml:space="preserve">+ <value>Sentence case</value>+ </data>+ <data name="Sentences" xml:space="preserve">+ <value>Sentences:</value>+ </data>+ <data name="SnakeCase" xml:space="preserve">+ <value>snake_case</value>+ </data>+ <data name="Statistics" xml:space="preserve">+ <value>Statistics</value>+ </data>+ <data name="String" xml:space="preserve">+ <value>String</value>+ </data>+ <data name="TitleCase" xml:space="preserve">+ <value>Title Case</value>+ </data>+ <data name="TrainCase" xml:space="preserve">+ <value>Train-Case</value>+ </data>+ <data name="UpperCase" xml:space="preserve">+ <value>UPPER CASE</value>+ </data>+ <data name="WordDistribution" xml:space="preserve">+ <value>Word distribution</value>+ </data>+ <data name="Words" xml:space="preserve">+ <value>Words:</value>+ </data>+</root>\ No newline at end of filediff --git a/src/dev/impl/DevToys/Strings/fr/StringUtilities.resw b/src/dev/impl/DevToys/Strings/fr/StringUtilities.reswnew file mode 100644index 000000000..675dfffa2--- /dev/null+++ b/src/dev/impl/DevToys/Strings/fr/StringUtilities.resw@@ -0,0 +1,210 @@+<?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="AlternatingCase" xml:space="preserve">+ <value>aLtErNaTiNg cAsE</value>+ </data>+ <data name="Bytes" xml:space="preserve">+ <value>Bytes:</value>+ </data>+ <data name="CamelCase" xml:space="preserve">+ <value>camelCase</value>+ </data>+ <data name="CharacterDistribution" xml:space="preserve">+ <value>Distribution des caractères</value>+ </data>+ <data name="Characters" xml:space="preserve">+ <value>Caractères:</value>+ </data>+ <data name="CobolCase" xml:space="preserve">+ <value>COBOL-CASE</value>+ </data>+ <data name="Column" xml:space="preserve">+ <value>Colonne:</value>+ </data>+ <data name="ConstantCase" xml:space="preserve">+ <value>CONSTANT_CASE</value>+ </data>+ <data name="Convert" xml:space="preserve">+ <value>Convertir</value>+ </data>+ <data name="DisplayName" xml:space="preserve">+ <value>Chaîne de caractères</value>+ </data>+ <data name="InverseCase" xml:space="preserve">+ <value>InVeRsE CaSe</value>+ </data>+ <data name="KebabCase" xml:space="preserve">+ <value>kebab-case</value>+ </data>+ <data name="Line" xml:space="preserve">+ <value>Ligne:</value>+ </data>+ <data name="Lines" xml:space="preserve">+ <value>Lignes:</value>+ </data>+ <data name="LowerCase" xml:space="preserve">+ <value>minuscule</value>+ </data>+ <data name="OriginalCase" xml:space="preserve">+ <value>Texte original</value>+ </data>+ <data name="Paragraphs" xml:space="preserve">+ <value>Paragraphes:</value>+ </data>+ <data name="PascalCase" xml:space="preserve">+ <value>PascalCase</value>+ </data>+ <data name="Position" xml:space="preserve">+ <value>Position:</value>+ </data>+ <data name="Selection" xml:space="preserve">+ <value>Sélection</value>+ </data>+ <data name="SentenceCase" xml:space="preserve">+ <value>Sentence case</value>+ </data>+ <data name="Sentences" xml:space="preserve">+ <value>Phrases:</value>+ </data>+ <data name="SnakeCase" xml:space="preserve">+ <value>snake_case</value>+ </data>+ <data name="Statistics" xml:space="preserve">+ <value>Statistiques</value>+ </data>+ <data name="String" xml:space="preserve">+ <value>Texte</value>+ </data>+ <data name="TitleCase" xml:space="preserve">+ <value>Title Case</value>+ </data>+ <data name="TrainCase" xml:space="preserve">+ <value>Train-Case</value>+ </data>+ <data name="UpperCase" xml:space="preserve">+ <value>CAPITAL</value>+ </data>+ <data name="WordDistribution" xml:space="preserve">+ <value>Distribution des mots</value>+ </data>+ <data name="Words" xml:space="preserve">+ <value>Mots:</value>+ </data>+</root>\ No newline at end of filediff --git a/src/dev/impl/DevToys/Strings/ru/StringUtilities.resw b/src/dev/impl/DevToys/Strings/ru/StringUtilities.reswnew file mode 100644index 000000000..08c882244--- /dev/null+++ b/src/dev/impl/DevToys/Strings/ru/StringUtilities.resw@@ -0,0 +1,210 @@+<?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="AlternatingCase" xml:space="preserve">+ <value>aLtErNaTiNg cAsE</value>+ </data>+ <data name="Bytes" xml:space="preserve">+ <value>Bytes:</value>+ </data>+ <data name="CamelCase" xml:space="preserve">+ <value>camelCase</value>+ </data>+ <data name="CharacterDistribution" xml:space="preserve">+ <value>Character distribution</value>+ </data>+ <data name="Characters" xml:space="preserve">+ <value>Characters:</value>+ </data>+ <data name="CobolCase" xml:space="preserve">+ <value>COBOL-CASE</value>+ </data>+ <data name="Column" xml:space="preserve">+ <value>Column:</value>+ </data>+ <data name="ConstantCase" xml:space="preserve">+ <value>CONSTANT_CASE</value>+ </data>+ <data name="Convert" xml:space="preserve">+ <value>Convert</value>+ </data>+ <data name="DisplayName" xml:space="preserve">+ <value>String Utilities</value>+ </data>+ <data name="InverseCase" xml:space="preserve">+ <value>InVeRsE CaSe</value>+ </data>+ <data name="KebabCase" xml:space="preserve">+ <value>kebab-case</value>+ </data>+ <data name="Line" xml:space="preserve">+ <value>Line:</value>+ </data>+ <data name="Lines" xml:space="preserve">+ <value>Lines:</value>+ </data>+ <data name="LowerCase" xml:space="preserve">+ <value>lower case</value>+ </data>+ <data name="OriginalCase" xml:space="preserve">+ <value>Original text</value>+ </data>+ <data name="Paragraphs" xml:space="preserve">+ <value>Paragraphs:</value>+ </data>+ <data name="PascalCase" xml:space="preserve">+ <value>PascalCase</value>+ </data>+ <data name="Position" xml:space="preserve">+ <value>Position:</value>+ </data>+ <data name="Selection" xml:space="preserve">+ <value>Selection</value>+ </data>+ <data name="SentenceCase" xml:space="preserve">+ <value>Sentence case</value>+ </data>+ <data name="Sentences" xml:space="preserve">+ <value>Sentences:</value>+ </data>+ <data name="SnakeCase" xml:space="preserve">+ <value>snake_case</value>+ </data>+ <data name="Statistics" xml:space="preserve">+ <value>Statistics</value>+ </data>+ <data name="String" xml:space="preserve">+ <value>String</value>+ </data>+ <data name="TitleCase" xml:space="preserve">+ <value>Title Case</value>+ </data>+ <data name="TrainCase" xml:space="preserve">+ <value>Train-Case</value>+ </data>+ <data name="UpperCase" xml:space="preserve">+ <value>UPPER CASE</value>+ </data>+ <data name="WordDistribution" xml:space="preserve">+ <value>Word distribution</value>+ </data>+ <data name="Words" xml:space="preserve">+ <value>Words:</value>+ </data>+</root>\ No newline at end of filediff --git a/src/dev/impl/DevToys/ViewModels/Tools/StringUtilities/StringUtilitiesToolProvider.cs b/src/dev/impl/DevToys/ViewModels/Tools/StringUtilities/StringUtilitiesToolProvider.csnew file mode 100644index 000000000..4b374f7b0--- /dev/null+++ b/src/dev/impl/DevToys/ViewModels/Tools/StringUtilities/StringUtilitiesToolProvider.cs@@ -0,0 +1,55 @@+#nullable enable++using DevToys.Api.Core.Injection;+using DevToys.Api.Tools;+using DevToys.Core.Threading;+using System.Composition;+using System.Threading.Tasks;+using Windows.UI.Xaml;+using Windows.UI.Xaml.Controls;+using Windows.UI.Xaml.Media;++namespace DevToys.ViewModels.Tools.StringUtilities+{+ [Export(typeof(IToolProvider))]+ [Name("String Utilities")]+ [ProtocolName("string")]+ [Order(0)]+ [NotScrollable]+ internal sealed class StringUtilitiesToolProvider : ToolProviderBase, IToolProvider+ {+ private readonly IMefProvider _mefProvider;++ public string? DisplayName => LanguageManager.Instance.StringUtilities.DisplayName;++ public object IconSource { get; }++ [ImportingConstructor]+ public StringUtilitiesToolProvider(IMefProvider mefProvider)+ {+ _mefProvider = mefProvider;++ IconSource+ = new TaskCompletionNotifier<IconElement>(+ ThreadHelper.RunOnUIThreadAsync(() =>+ {+ return Task.FromResult<IconElement>(+ new FontIcon+ {+ FontFamily = (FontFamily)Application.Current.Resources["FluentSystemIcons"],+ Glyph = "\uF793"+ });+ }));+ }++ public bool CanBeTreatedByTool(string data)+ {+ return false;+ }++ public IToolViewModel CreateTool()+ {+ return _mefProvider.Import<StringUtilitiesToolViewModel>();+ }+ }+}diff --git a/src/dev/impl/DevToys/ViewModels/Tools/StringUtilities/StringUtilitiesToolViewModel.cs b/src/dev/impl/DevToys/ViewModels/Tools/StringUtilities/StringUtilitiesToolViewModel.csnew file mode 100644index 000000000..1efc9eed9--- /dev/null+++ b/src/dev/impl/DevToys/ViewModels/Tools/StringUtilities/StringUtilitiesToolViewModel.cs@@ -0,0 +1,854 @@+#nullable enable++using DevToys.Api.Tools;+using DevToys.Core.Threading;+using DevToys.Views.Tools.StringUtilities;+using Microsoft.Toolkit.Mvvm.ComponentModel;+using Microsoft.Toolkit.Mvvm.Input;+using System;+using System.Collections.Generic;+using System.Composition;+using System.Linq;+using System.Text;+using System.Text.RegularExpressions;+using System.Threading.Tasks;++namespace DevToys.ViewModels.Tools.StringUtilities+{+ [Export(typeof(StringUtilitiesToolViewModel))]+ public sealed class StringUtilitiesToolViewModel : ObservableRecipient, IToolViewModel+ {+ private static readonly object _lockObject = new();++ private bool _forbidBackup;+ private string? _text;+ private string? _textBackup;+ private string? _wordDistribution;+ private string? _characterDistribution;+ private int _selectionStart;+ private int _line;+ private int _column;+ private int _position;+ private int _characters;+ private int _words;+ private int _lines;+ private int _sentences;+ private int _paragraphs;+ private int _bytes;++ public Type View { get; } = typeof(StringUtilitiesToolPage);++ internal StringUtilitiesStrings Strings => LanguageManager.Instance.StringUtilities;++ internal string? Text+ {+ get => _text;+ set+ {+ lock (_lockObject)+ {+ if (!_forbidBackup)+ {+ _textBackup = value;+ }+ SetProperty(ref _text, value);+ OnPropertyChanged(nameof(OriginalCaseCommand));+ QueueTextStatisticCalculation();+ }+ }+ }++ internal int SelectionStart+ {+ get => _selectionStart;+ set+ {+ SetProperty(ref _selectionStart, value);+ QueueSelectionStatisticCalculation();+ }+ }++ internal int Line+ {+ get => _line;+ set => SetProperty(ref _line, value);+ }++ internal int Column+ {+ get => _column;+ set => SetProperty(ref _column, value);+ }++ internal int Position+ {+ get => _position;+ set => SetProperty(ref _position, value);+ }++ internal int Characters+ {+ get => _characters;+ set => SetProperty(ref _characters, value);+ }++ internal int Words+ {+ get => _words;+ set => SetProperty(ref _words, value);+ }++ internal int Lines+ {+ get => _lines;+ set => SetProperty(ref _lines, value);+ }++ internal int Sentences+ {+ get => _sentences;+ set => SetProperty(ref _sentences, value);+ }++ internal int Paragraphs+ {+ get => _paragraphs;+ set => SetProperty(ref _paragraphs, value);+ }++ internal int Bytes+ {+ get => _bytes;+ set => SetProperty(ref _bytes, value);+ }++ internal string? WordDistribution+ {+ get => _wordDistribution;+ set => SetProperty(ref _wordDistribution, value);+ }++ internal string? CharacterDistribution+ {+ get => _characterDistribution;+ set => SetProperty(ref _characterDistribution, value);+ }++ [ImportingConstructor]+ public StringUtilitiesToolViewModel()+ {+ OriginalCaseCommand = new RelayCommand(ExecuteOriginalCaseCommand, CanExecuteOriginalCaseCommand);+ SentenceCaseCommand = new RelayCommand(ExecuteSentenceCaseCommand);+ LowerCaseCommand = new RelayCommand(ExecuteLowerCaseCommand);+ UpperCaseCommand = new RelayCommand(ExecuteUpperCaseCommand);+ TitleCaseCommand = new RelayCommand(ExecuteTitleCaseCommand);+ CamelCaseCommand = new RelayCommand(ExecuteCamelCaseCommand);+ PascalCaseCommand = new RelayCommand(ExecutePascalCaseCommand);+ SnakeCaseCommand = new RelayCommand(ExecuteSnakeCaseCommand);+ ConstantCaseCommand = new RelayCommand(ExecuteConstantCaseCommand);+ KebabCaseCommand = new RelayCommand(ExecuteKebabCaseCommand);+ CobolCaseCommand = new RelayCommand(ExecuteCobolCaseCommand);+ TrainCaseCommand = new RelayCommand(ExecuteTrainCaseCommand);+ AlternatingCaseCommand = new RelayCommand(ExecuteAlternatingCaseCommand);+ InverseCaseCommand = new RelayCommand(ExecuteInverseCaseCommand);++ QueueSelectionStatisticCalculation();+ QueueTextStatisticCalculation();+ }++ #region OriginalCaseCommand++ public IRelayCommand OriginalCaseCommand { get; }++ private bool CanExecuteOriginalCaseCommand()+ {+ return !string.IsNullOrEmpty(_textBackup) && !string.Equals(_text, _textBackup, StringComparison.Ordinal);+ }++ private void ExecuteOriginalCaseCommand()+ {+ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = _textBackup;+ _forbidBackup = false;+ }+ }++ #endregion++ #region SentenceCaseCommand++ public IRelayCommand SentenceCaseCommand { get; }++ private void ExecuteSentenceCaseCommand()+ {+ char[]? sentenceCaseString = _textBackup?.ToCharArray();+ if (sentenceCaseString is null)+ {+ return;+ }++ bool newSentence = true;+ for (int i = 0; i < sentenceCaseString.Length; i++)+ {+ if (sentenceCaseString[i] is '.' or '?' or '!' or '\r')+ {+ newSentence = true;+ continue;+ }++ if (char.IsLetterOrDigit(sentenceCaseString[i]))+ {+ if (newSentence)+ {+ sentenceCaseString[i] = char.ToUpperInvariant(sentenceCaseString[i]);+ newSentence = false;+ }+ else+ {+ sentenceCaseString[i] = char.ToLowerInvariant(sentenceCaseString[i]);+ }+ }+ }++ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = new string(sentenceCaseString);+ _forbidBackup = false;+ }+ }++ #endregion++ #region LowerCaseCommand++ public IRelayCommand LowerCaseCommand { get; }++ private void ExecuteLowerCaseCommand()+ {+ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = _textBackup?.ToLowerInvariant();+ _forbidBackup = false;+ }+ }++ #endregion++ #region UpperCaseCommand++ public IRelayCommand UpperCaseCommand { get; }++ private void ExecuteUpperCaseCommand()+ {+ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = _textBackup?.ToUpperInvariant();+ _forbidBackup = false;+ }+ }++ #endregion++ #region TitleCaseCommand++ public IRelayCommand TitleCaseCommand { get; }++ private void ExecuteTitleCaseCommand()+ {+ char[]? titleCaseString = _textBackup?.ToCharArray();+ if (titleCaseString is null)+ {+ return;+ }++ for (int i = 0; i < titleCaseString.Length; i++)+ {+ if (i == 0+ || !char.IsLetterOrDigit(titleCaseString[i - 1]))+ {+ titleCaseString[i] = char.ToUpperInvariant(titleCaseString[i]);+ }+ else+ {+ titleCaseString[i] = char.ToLowerInvariant(titleCaseString[i]);+ }+ }++ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = new string(titleCaseString);+ _forbidBackup = false;+ }+ }++ #endregion++ #region CamelCaseCommand++ public IRelayCommand CamelCaseCommand { get; }++ private void ExecuteCamelCaseCommand()+ {+ string? text = _textBackup;+ if (text is null)+ {+ return;+ }++ var camelCaseStringBuilder = new StringBuilder();+ var nextLetterOrDigitShouldBeUppercase = false;++ for (int i = 0; i < text.Length; i++)+ {+ char currentChar = text[i];+ if (char.IsLetterOrDigit(currentChar))+ {+ if (nextLetterOrDigitShouldBeUppercase)+ {+ camelCaseStringBuilder.Append(char.ToUpperInvariant(currentChar));+ nextLetterOrDigitShouldBeUppercase = false;+ }+ else+ {+ camelCaseStringBuilder.Append(char.ToLowerInvariant(currentChar));+ }+ }+ else+ {+ if (currentChar == '\r')+ {+ nextLetterOrDigitShouldBeUppercase = false;+ camelCaseStringBuilder.Append(currentChar);+ }+ else+ {+ nextLetterOrDigitShouldBeUppercase = true;+ }+ }+ }++ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = camelCaseStringBuilder.ToString();+ _forbidBackup = false;+ }+ }++ #endregion++ #region PascalCaseCommand++ public IRelayCommand PascalCaseCommand { get; }++ private void ExecutePascalCaseCommand()+ {+ string? text = _textBackup;+ if (text is null)+ {+ return;+ }++ var pascalCaseStringBuilder = new StringBuilder();+ var nextLetterOrDigitShouldBeUppercase = true;++ for (int i = 0; i < text.Length; i++)+ {+ char currentChar = text[i];+ if (char.IsLetterOrDigit(currentChar))+ {+ if (nextLetterOrDigitShouldBeUppercase)+ {+ pascalCaseStringBuilder.Append(char.ToUpperInvariant(currentChar));+ nextLetterOrDigitShouldBeUppercase = false;+ }+ else+ {+ pascalCaseStringBuilder.Append(char.ToLowerInvariant(currentChar));+ }+ }+ else+ {+ nextLetterOrDigitShouldBeUppercase = true;+ if (currentChar == '\r')+ {+ pascalCaseStringBuilder.Append(currentChar);+ }+ }+ }++ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = pascalCaseStringBuilder.ToString();+ _forbidBackup = false;+ }+ }++ #endregion++ #region SnakeCaseCommand++ public IRelayCommand SnakeCaseCommand { get; }++ private void ExecuteSnakeCaseCommand()+ {+ string? text = _textBackup;+ if (text is null)+ {+ return;+ }++ var snakeCase = SnakeConstantKebabCobolCaseConverter(text, '_', isUpperCase: false);++ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = snakeCase;+ _forbidBackup = false;+ }+ }++ #endregion++ #region ConstantCaseCommand++ public IRelayCommand ConstantCaseCommand { get; }++ private void ExecuteConstantCaseCommand()+ {+ string? text = _textBackup;+ if (text is null)+ {+ return;+ }++ var constantCase = SnakeConstantKebabCobolCaseConverter(text, '_', isUpperCase: true);++ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = constantCase;+ _forbidBackup = false;+ }+ }++ #endregion++ #region KebabCaseCommand++ public IRelayCommand KebabCaseCommand { get; }++ private void ExecuteKebabCaseCommand()+ {+ string? text = _textBackup;+ if (text is null)+ {+ return;+ }++ var kebabCase = SnakeConstantKebabCobolCaseConverter(text, '-', isUpperCase: false);++ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = kebabCase;+ _forbidBackup = false;+ }+ }++ #endregion++ #region CobolCaseCommand++ public IRelayCommand CobolCaseCommand { get; }++ private void ExecuteCobolCaseCommand()+ {+ string? text = _textBackup;+ if (text is null)+ {+ return;+ }++ var cobolCase = SnakeConstantKebabCobolCaseConverter(text, '-', isUpperCase: true);++ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = cobolCase;+ _forbidBackup = false;+ }+ }++ #endregion++ #region TrainCaseCommand++ public IRelayCommand TrainCaseCommand { get; }++ private void ExecuteTrainCaseCommand()+ {+ string? text = _textBackup;+ if (text is null)+ {+ return;+ }++ var snakeCaseStringBuilder = new StringBuilder();++ var nextNonLetterOrDigitShouldBeIgnored = true;+ for (int i = 0; i < text.Length; i++)+ {+ char currentChar = text[i];+ if (char.IsLetterOrDigit(currentChar))+ {+ if (nextNonLetterOrDigitShouldBeIgnored)+ {+ snakeCaseStringBuilder.Append(char.ToUpperInvariant(currentChar));+ }+ else+ {+ snakeCaseStringBuilder.Append(char.ToLowerInvariant(currentChar));+ }+ nextNonLetterOrDigitShouldBeIgnored = false;+ }+ else if (currentChar == '\r')+ {+ nextNonLetterOrDigitShouldBeIgnored = true;+ snakeCaseStringBuilder.Append(currentChar);+ }+ else if (!nextNonLetterOrDigitShouldBeIgnored)+ {+ if (i < text.Length - 1+ && char.IsLetterOrDigit(text[i + 1]))+ {+ nextNonLetterOrDigitShouldBeIgnored = true;+ snakeCaseStringBuilder.Append('-');+ }+ }+ }+++ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = snakeCaseStringBuilder.ToString();+ _forbidBackup = false;+ }+ }++ #endregion++ #region AlternatingCaseCommand++ public IRelayCommand AlternatingCaseCommand { get; }++ private void ExecuteAlternatingCaseCommand()+ {+ char[]? titleCaseString = _textBackup?.ToCharArray();+ if (titleCaseString is null)+ {+ return;+ }++ bool lowerCase = true;+ for (int i = 0; i < titleCaseString.Length; i++)+ {+ if (lowerCase)+ {+ titleCaseString[i] = char.ToLowerInvariant(titleCaseString[i]);+ }+ else+ {+ titleCaseString[i] = char.ToUpperInvariant(titleCaseString[i]);+ }++ lowerCase = !lowerCase;+ }++ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = new string(titleCaseString);+ _forbidBackup = false;+ }+ }++ #endregion++ #region InverseCaseCommand++ public IRelayCommand InverseCaseCommand { get; }++ private void ExecuteInverseCaseCommand()+ {+ char[]? titleCaseString = _textBackup?.ToCharArray();+ if (titleCaseString is null)+ {+ return;+ }++ bool lowerCase = false;+ for (int i = 0; i < titleCaseString.Length; i++)+ {+ if (lowerCase)+ {+ titleCaseString[i] = char.ToLowerInvariant(titleCaseString[i]);+ }+ else+ {+ titleCaseString[i] = char.ToUpperInvariant(titleCaseString[i]);+ }++ lowerCase = !lowerCase;+ }++ lock (_lockObject)+ {+ _forbidBackup = true;+ Text = new string(titleCaseString);+ _forbidBackup = false;+ }+ }++ #endregion++ private string SnakeConstantKebabCobolCaseConverter(string text, char spaceReplacement, bool isUpperCase)+ {+ var snakeCaseStringBuilder = new StringBuilder();++ var nextNonLetterOrDigitShouldBeIgnored = true;+ for (int i = 0; i < text.Length; i++)+ {+ char currentChar = text[i];+ if (char.IsLetterOrDigit(currentChar))+ {+ nextNonLetterOrDigitShouldBeIgnored = false;+ if (isUpperCase)+ {+ snakeCaseStringBuilder.Append(char.ToUpperInvariant(currentChar));+ }+ else+ {+ snakeCaseStringBuilder.Append(char.ToLowerInvariant(currentChar));+ }+ }+ else if (currentChar == '\r')+ {+ nextNonLetterOrDigitShouldBeIgnored = true;+ snakeCaseStringBuilder.Append(currentChar);+ }+ else if (!nextNonLetterOrDigitShouldBeIgnored)+ {+ if (i < text.Length - 1+ && char.IsLetterOrDigit(text[i + 1]))+ {+ nextNonLetterOrDigitShouldBeIgnored = true;+ snakeCaseStringBuilder.Append(spaceReplacement);+ }+ }+ }++ return snakeCaseStringBuilder.ToString();+ }++ private void QueueTextStatisticCalculation()+ {+ CalculateTextStatisticsAsync(Text).Forget();+ }++ private void QueueSelectionStatisticCalculation()+ {+ if (string.IsNullOrEmpty(Text))+ {+ Line = 1;+ Column = 0;+ return;+ }++ CalculateSelectionStatisticsAsync(Text!, SelectionStart).Forget();+ }++ private async Task CalculateTextStatisticsAsync(string? text)+ {+ await TaskScheduler.Default;++ int characters = 0;+ int words = 0;+ int lines = 1;+ int sentences = 0;+ int paragraphs = 1;+ int bytes = 0;+ string wordDistribution = string.Empty;+ string characterDistribution = string.Empty;++ if (!string.IsNullOrEmpty(text))+ {+ // Characters+ characters = text!.Length;++ // Bytes+ bytes = Encoding.UTF8.GetByteCount(text);++ // Words count+ MatchCollection matches = Regex.Matches(text, @"\b[\w]*\b");+ words = matches.Count(m => m.Length > 0);++ // Word distribution+ var stringBuilder = new StringBuilder();+ var wordFrequency+ = matches+ .Where(m => m.Length > 0)+ .GroupBy(m => m.Value)+ .OrderByDescending(m => m.Count())+ .ThenBy(m => m.Key);+ foreach (IGrouping<string, Match>? item in wordFrequency)+ {+ if (item is not null)+ {+ stringBuilder.AppendLine($"{item.Key}: {item.Count()}");+ }+ }+ wordDistribution = stringBuilder.ToString();++ // Paragraphs+ matches = Regex.Matches(text, @"[^\r\n]*[^ \r\n]+[^\r\n]*((\r|\n|\r\n)[^\r\n]*[^ \r\n]+[^\r\n]*)*");+ paragraphs = matches.Count(m => m.Length > 0);++ var characterFrequency = new Dictionary<char, int>();+ int sentenceBeginningPosition = 0;++ for (int i = 0; i < text.Length; i++)+ {+ char currentChar = text[i];++ // Detect lines+ if (currentChar == '\r')+ {+ lines++;+ }++ // Detect sentences.+ if (currentChar is '.' or '?' or '!' or '\r')+ {+ if (!IsSpanEmptyOrNotLetterAndDigit(text, sentenceBeginningPosition, i))+ {+ sentences++;+ sentenceBeginningPosition = i + 1;+ }+ }++ if (currentChar == '\r')+ {+ continue;+ }++ if (currentChar == ' ')+ {+ currentChar = '⎵';+ }++ if (!characterFrequency.TryAdd(currentChar, 1))+ {+ characterFrequency[currentChar]++;+ }+ }++ if (sentenceBeginningPosition < text.Length - 1+ && !IsSpanEmptyOrNotLetterAndDigit(text, sentenceBeginningPosition, text.Length))+ {+ sentences++;+ }++ // Character distributions+ stringBuilder.Clear();+ foreach (var item in characterFrequency.OrderByDescending(m => m.Value).ThenBy(m => m.Key))+ {+ stringBuilder.AppendLine($"{item.Key}: {item.Value}");+ }+ characterDistribution = stringBuilder.ToString();+ }++ await ThreadHelper.RunOnUIThreadAsync(+ () =>+ {+ Characters = characters;+ Words = words;+ Lines = lines;+ Sentences = sentences;+ Paragraphs = paragraphs;+ Bytes = bytes;+ WordDistribution = wordDistribution;+ CharacterDistribution = characterDistribution;+ });+ }++ private async Task CalculateSelectionStatisticsAsync(string text, int selectionStart)+ {+ await TaskScheduler.Default;++ int column;+ int line = CountLines(text, selectionStart);+ int beginningOfLinePosition = text.LastIndexOf('\r', Math.Max(0, Math.Min(selectionStart - 1, text.Length - 1)));+ if (beginningOfLinePosition == -1)+ {+ column = selectionStart;+ }+ else+ {+ column = Math.Max(selectionStart - beginningOfLinePosition - 1, 0);+ }++ await ThreadHelper.RunOnUIThreadAsync(+ () =>+ {+ Line = line;+ Column = column;+ });+ }++ private int CountLines(string text, int length)+ {+ int lineCount = 1;++ if (string.IsNullOrEmpty(text))+ {+ return lineCount;+ }++ int index = -1;+ while (-1 != (index = text.IndexOf('\r', index + 1, length - (index + 1))))+ {+ lineCount++;+ }++ return lineCount;+ }++ private bool IsSpanEmptyOrNotLetterAndDigit(string text, int start, int end)+ {+ if (start < 0 || end > text.Length)+ {+ throw new ArgumentOutOfRangeException();+ }++ for (int i = start; i < end; i++)+ {+ char currentChar = text[i];+ if (char.IsLetterOrDigit(currentChar))+ {+ return false;+ }+ }++ return true;+ }+ }+}diff --git a/src/dev/impl/DevToys/Views/Tools/StringUtilities/StringUtilitiesToolPage.xaml b/src/dev/impl/DevToys/Views/Tools/StringUtilities/StringUtilitiesToolPage.xamlnew file mode 100644index 000000000..7edc3d491--- /dev/null+++ b/src/dev/impl/DevToys/Views/Tools/StringUtilities/StringUtilitiesToolPage.xaml@@ -0,0 +1,134 @@+<Page+ x:Class="DevToys.Views.Tools.StringUtilities.StringUtilitiesToolPage"+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"+ xmlns:controls="using:DevToys.UI.Controls"+ xmlns:toolkit="using:Microsoft.Toolkit.Uwp.UI.Controls"+ mc:Ignorable="d"+ NavigationCacheMode="Required">++ <Grid Margin="0,0,0,16" RowSpacing="12" ColumnSpacing="12">+ <Grid.ChildrenTransitions>+ <TransitionCollection>+ <EntranceThemeTransition IsStaggeringEnabled="True" FromVerticalOffset="50"/>+ </TransitionCollection>+ </Grid.ChildrenTransitions>++ <Grid.RowDefinitions>+ <RowDefinition Height="Auto"/>+ <RowDefinition Height="*"/>+ </Grid.RowDefinitions>++ <Grid.ColumnDefinitions>+ <ColumnDefinition Width="*"/>+ <ColumnDefinition Width="Auto"/>+ </Grid.ColumnDefinitions>++ <controls:CustomTextBox+ Grid.Row="1"+ Grid.Column="0"+ Header="{x:Bind ViewModel.Strings.String}"+ AcceptsReturn="True"+ IsRichTextEdit="False"+ Text="{x:Bind ViewModel.Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"+ SelectionStart="{x:Bind ViewModel.SelectionStart, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>++ <StackPanel+ Grid.Row="0"+ Grid.Column="0"+ Grid.ColumnSpan="2"+ Spacing="4">+ <TextBlock Style="{StaticResource SubTitleTextBlock}" Text="{x:Bind ViewModel.Strings.Convert}" />++ <toolkit:WrapPanel VerticalSpacing="4" HorizontalSpacing="4">+ <Button Content="{x:Bind ViewModel.Strings.OriginalCase}" Command="{x:Bind ViewModel.OriginalCaseCommand, Mode=OneWay}"/>+ <Button Content="{x:Bind ViewModel.Strings.SentenceCase}" Command="{x:Bind ViewModel.SentenceCaseCommand}"/>+ <Button Content="{x:Bind ViewModel.Strings.LowerCase}" Command="{x:Bind ViewModel.LowerCaseCommand}"/>+ <Button Content="{x:Bind ViewModel.Strings.UpperCase}" Command="{x:Bind ViewModel.UpperCaseCommand}"/>+ <Button Content="{x:Bind ViewModel.Strings.TitleCase}" Command="{x:Bind ViewModel.TitleCaseCommand}"/>+ <Button Content="{x:Bind ViewModel.Strings.CamelCase}" Command="{x:Bind ViewModel.CamelCaseCommand}"/>+ <Button Content="{x:Bind ViewModel.Strings.PascalCase}" Command="{x:Bind ViewModel.PascalCaseCommand}"/>+ <Button Content="{x:Bind ViewModel.Strings.SnakeCase}" Command="{x:Bind ViewModel.SnakeCaseCommand}"/>+ <Button Content="{x:Bind ViewModel.Strings.ConstantCase}" Command="{x:Bind ViewModel.ConstantCaseCommand}"/>+ <Button Content="{x:Bind ViewModel.Strings.KebabCase}" Command="{x:Bind ViewModel.KebabCaseCommand}"/>+ <Button Content="{x:Bind ViewModel.Strings.CobolCase}" Command="{x:Bind ViewModel.CobolCaseCommand}"/>+ <Button Content="{x:Bind ViewModel.Strings.TrainCase}" Command="{x:Bind ViewModel.TrainCaseCommand}"/>+ <Button Content="{x:Bind ViewModel.Strings.AlternatingCase}" Command="{x:Bind ViewModel.AlternatingCaseCommand}"/>+ <Button Content="{x:Bind ViewModel.Strings.InverseCase}" Command="{x:Bind ViewModel.InverseCaseCommand}"/>+ </toolkit:WrapPanel>+ </StackPanel>++ <StackPanel+ Grid.Row="1"+ Grid.Column="1"+ Spacing="4"+ Width="200">+ <TextBlock Style="{StaticResource SubTitleTextBlock}" Text="{x:Bind ViewModel.Strings.Selection}" />+ <Grid ColumnSpacing="12" RowSpacing="4">+ <Grid.ColumnDefinitions>+ <ColumnDefinition Width="*"/>+ <ColumnDefinition Width="Auto"/>+ </Grid.ColumnDefinitions>+ <Grid.RowDefinitions>+ <RowDefinition/>+ <RowDefinition/>+ <RowDefinition/>+ </Grid.RowDefinitions>+ <TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Bind ViewModel.Strings.Line}"/>+ <TextBlock Grid.Row="0" Grid.Column="1" Text="{x:Bind ViewModel.Line, Mode=OneWay}"/>+ <TextBlock Grid.Row="1" Grid.Column="0" Text="{x:Bind ViewModel.Strings.Column}"/>+ <TextBlock Grid.Row="1" Grid.Column="1" Text="{x:Bind ViewModel.Column, Mode=OneWay}"/>+ <TextBlock Grid.Row="2" Grid.Column="0" Text="{x:Bind ViewModel.Strings.Position}"/>+ <TextBlock Grid.Row="2" Grid.Column="1" Text="{x:Bind ViewModel.SelectionStart, Mode=OneWay}"/>+ </Grid>++ <TextBlock Style="{StaticResource SubTitleTextBlock}" Text="{x:Bind ViewModel.Strings.Statistics}" />+ <Grid ColumnSpacing="12" RowSpacing="4">+ <Grid.ColumnDefinitions>+ <ColumnDefinition Width="*"/>+ <ColumnDefinition Width="Auto"/>+ </Grid.ColumnDefinitions>+ <Grid.RowDefinitions>+ <RowDefinition/>+ <RowDefinition/>+ <RowDefinition/>+ <RowDefinition/>+ <RowDefinition/>+ <RowDefinition/>+ </Grid.RowDefinitions>+ <TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Bind ViewModel.Strings.Characters}"/>+ <TextBlock Grid.Row="0" Grid.Column="1" Text="{x:Bind ViewModel.Characters, Mode=OneWay}"/>+ <TextBlock Grid.Row="1" Grid.Column="0" Text="{x:Bind ViewModel.Strings.Words}"/>+ <TextBlock Grid.Row="1" Grid.Column="1" Text="{x:Bind ViewModel.Words, Mode=OneWay}"/>+ <TextBlock Grid.Row="2" Grid.Column="0" Text="{x:Bind ViewModel.Strings.Lines}"/>+ <TextBlock Grid.Row="2" Grid.Column="1" Text="{x:Bind ViewModel.Lines, Mode=OneWay}"/>+ <TextBlock Grid.Row="3" Grid.Column="0" Text="{x:Bind ViewModel.Strings.Sentences}"/>+ <TextBlock Grid.Row="3" Grid.Column="1" Text="{x:Bind ViewModel.Sentences, Mode=OneWay}"/>+ <TextBlock Grid.Row="4" Grid.Column="0" Text="{x:Bind ViewModel.Strings.Paragraphs}"/>+ <TextBlock Grid.Row="4" Grid.Column="1" Text="{x:Bind ViewModel.Paragraphs, Mode=OneWay}"/>+ <TextBlock Grid.Row="5" Grid.Column="0" Text="{x:Bind ViewModel.Strings.Bytes}"/>+ <TextBlock Grid.Row="5" Grid.Column="1" Text="{x:Bind ViewModel.Bytes, Mode=OneWay}"/>+ </Grid>++ <TextBlock Style="{StaticResource SubTitleTextBlock}" Text="{x:Bind ViewModel.Strings.WordDistribution}" />+ <TextBox+ MaxHeight="200"+ IsReadOnly="True"+ AcceptsReturn="True"+ ScrollViewer.VerticalScrollBarVisibility="Auto"+ ScrollViewer.HorizontalScrollBarVisibility="Auto"+ Text="{x:Bind ViewModel.WordDistribution, Mode=OneWay}"/>++ <TextBlock Style="{StaticResource SubTitleTextBlock}" Text="{x:Bind ViewModel.Strings.CharacterDistribution}" />+ <TextBox+ MaxHeight="200"+ IsReadOnly="True"+ AcceptsReturn="True"+ ScrollViewer.VerticalScrollBarVisibility="Auto"+ ScrollViewer.HorizontalScrollBarVisibility="Auto"+ Text="{x:Bind ViewModel.CharacterDistribution, Mode=OneWay}"/>+ </StackPanel>+ </Grid>+</Page>diff --git a/src/dev/impl/DevToys/Views/Tools/StringUtilities/StringUtilitiesToolPage.xaml.cs b/src/dev/impl/DevToys/Views/Tools/StringUtilities/StringUtilitiesToolPage.xaml.csnew file mode 100644index 000000000..e99969cc6--- /dev/null+++ b/src/dev/impl/DevToys/Views/Tools/StringUtilities/StringUtilitiesToolPage.xaml.cs@@ -0,0 +1,50 @@+#nullable enable++using DevToys.Api.Core.Navigation;+using DevToys.Core;+using DevToys.ViewModels.Tools.StringUtilities;+using Windows.UI.Xaml;+using Windows.UI.Xaml.Controls;+using Windows.UI.Xaml.Navigation;++namespace DevToys.Views.Tools.StringUtilities+{+ public sealed partial class StringUtilitiesToolPage : Page+ {+ public static readonly DependencyProperty ViewModelProperty+ = DependencyProperty.Register(+ nameof(ViewModel),+ typeof(StringUtilitiesToolViewModel),+ typeof(StringUtilitiesToolPage),+ new PropertyMetadata(null));++ /// <summary>+ /// Gets the page's view model.+ /// </summary>+ public StringUtilitiesToolViewModel ViewModel+ {+ get => (StringUtilitiesToolViewModel)GetValue(ViewModelProperty);+ set => SetValue(ViewModelProperty, value);+ }++ public StringUtilitiesToolPage()+ {+ InitializeComponent();+ }++ protected override void OnNavigatedTo(NavigationEventArgs e)+ {+ if (ViewModel is null)+ {+ var parameters = (NavigationParameter)e.Parameter;++ // Set the view model+ Assumes.NotNull(parameters.ViewModel, nameof(parameters.ViewModel));+ ViewModel = (StringUtilitiesToolViewModel)parameters.ViewModel!;+ DataContext = ViewModel;+ }++ base.OnNavigatedTo(e);+ }+ }+}diff --git a/src/tests/DevToys.Tests/DevToys.Tests.csproj b/src/tests/DevToys.Tests/DevToys.Tests.csprojindex 321a5f463..aa37c05d1 100644--- a/src/tests/DevToys.Tests/DevToys.Tests.csproj+++ b/src/tests/DevToys.Tests/DevToys.Tests.csproj@@ -50,6 +50,7 @@<Compile Include="Properties\AssemblyInfo.cs" /><Compile Include="Providers\Tools\HashGeneratorTests.cs" /><Compile Include="Providers\Tools\Base64EncoderDecoderTests.cs" />+ <Compile Include="Providers\Tools\StringUtilitiesTests.cs" /><Compile Include="UI\ConvertersTests.cs" /><Compile Include="UnitTestApp.xaml.cs"><DependentUpon>UnitTestApp.xaml</DependentUpon>diff --git a/src/tests/DevToys.Tests/Providers/Tools/StringUtilitiesTests.cs b/src/tests/DevToys.Tests/Providers/Tools/StringUtilitiesTests.csnew file mode 100644index 000000000..4e3dc7a76--- /dev/null+++ b/src/tests/DevToys.Tests/Providers/Tools/StringUtilitiesTests.cs@@ -0,0 +1,534 @@+using DevToys.Core.Threading;+using DevToys.ViewModels.Tools.StringUtilities;+using Microsoft.VisualStudio.TestTools.UnitTesting;+using System.Threading.Tasks;++namespace DevToys.Tests.Providers.Tools+{+ [TestClass]+ public class StringUtilitiesTests : MefBaseTest+ {+ private const string Text+= @"UWP is one of many ways to create client applications for Windows. UWP apps use WinRT APIs to provide powerful UI and advanced asynchronous features that are ideal for internet-connected devices.++To download the tools you need to start creating UWP apps, see Get set up, and then write your first app.++Where does UWP fit in the Microsoft development story?+UWP is one choice for creating apps that run on Windows 10 devices, and can be combined with other platforms. UWP apps can make use of Win32 APIs and .NET classes (see API Sets for UWP apps, Dlls for UWP apps, and .NET for UWP apps).++The Microsoft development story continues to evolve, and along with initiatives such as WinUI, MSIX, and Project Reunion, UWP is a powerful tool for creating client apps.++Features of a UWP app+A UWP app is:++Secure: UWP apps declare which device resources and data they access. The user must authorize that access.+Able to use a common API on all devices that run Windows 10.+Able to use device specific capabilities and adapt the UI to different device screen sizes, resolutions, and DPI.+Available from the Microsoft Store on all devices (or only those that you specify) that run on Windows 10. The Microsoft Store provides multiple ways to make money on your app.+Able to be installed and uninstalled without risk to the machine or incurring ""machine rot"".+Engaging: use live tiles, push notifications, and user activities that interact with Windows Timeline and Cortana's Pick Up Where I Left Off, to engage users.+Programmable in C#, C++, Visual Basic, and Javascript. For UI, use WinUI, XAML, HTML, or DirectX.+Let's look at these in more detail.";++ [TestMethod]+ public async Task CalculateSelectionStatisticsAsync()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;+ viewModel.SelectionStart = 0;++ await Task.Delay(100);++ Assert.AreEqual(1, viewModel.Line);+ Assert.AreEqual(0, viewModel.Column);++ viewModel.SelectionStart = 1;++ await Task.Delay(100);++ Assert.AreEqual(1, viewModel.Line);+ Assert.AreEqual(1, viewModel.Column);++ viewModel.SelectionStart = 2;++ await Task.Delay(100);++ Assert.AreEqual(1, viewModel.Line);+ Assert.AreEqual(2, viewModel.Column);++ viewModel.SelectionStart = 810;++ await Task.Delay(100);++ Assert.AreEqual(11, viewModel.Line);+ Assert.AreEqual(13, viewModel.Column);++ viewModel.SelectionStart = 812;++ await Task.Delay(100);++ Assert.AreEqual(12, viewModel.Line);+ Assert.AreEqual(0, viewModel.Column);+ }++ [TestMethod]+ public async Task CalculateTextStatisticsAsync()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ await Task.Delay(100);++ Assert.AreEqual(1666, viewModel.Characters);+ Assert.AreEqual(288, viewModel.Words);+ Assert.AreEqual(20, viewModel.Lines);+ Assert.AreEqual(22, viewModel.Sentences);+ Assert.AreEqual(6, viewModel.Paragraphs);+ Assert.AreEqual(1666, viewModel.Bytes);+ }++ [TestMethod]+ public void SentenceCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.SentenceCaseCommand.Execute(null);++ string expectedResult+= @"Uwp is one of many ways to create client applications for windows. Uwp apps use winrt apis to provide powerful ui and advanced asynchronous features that are ideal for internet-connected devices.++To download the tools you need to start creating uwp apps, see get set up, and then write your first app.++Where does uwp fit in the microsoft development story?+Uwp is one choice for creating apps that run on windows 10 devices, and can be combined with other platforms. Uwp apps can make use of win32 apis and .Net classes (see api sets for uwp apps, dlls for uwp apps, and .Net for uwp apps).++The microsoft development story continues to evolve, and along with initiatives such as winui, msix, and project reunion, uwp is a powerful tool for creating client apps.++Features of a uwp app+A uwp app is:++Secure: uwp apps declare which device resources and data they access. The user must authorize that access.+Able to use a common api on all devices that run windows 10.+Able to use device specific capabilities and adapt the ui to different device screen sizes, resolutions, and dpi.+Available from the microsoft store on all devices (or only those that you specify) that run on windows 10. The microsoft store provides multiple ways to make money on your app.+Able to be installed and uninstalled without risk to the machine or incurring ""machine rot"".+Engaging: use live tiles, push notifications, and user activities that interact with windows timeline and cortana's pick up where i left off, to engage users.+Programmable in c#, c++, visual basic, and javascript. For ui, use winui, xaml, html, or directx.+Let's look at these in more detail.";++ Assert.AreEqual(expectedResult, viewModel.Text);+ }++ [TestMethod]+ public void LowerCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.LowerCaseCommand.Execute(null);++ string expectedResult+= @"uwp is one of many ways to create client applications for windows. uwp apps use winrt apis to provide powerful ui and advanced asynchronous features that are ideal for internet-connected devices.++to download the tools you need to start creating uwp apps, see get set up, and then write your first app.++where does uwp fit in the microsoft development story?+uwp is one choice for creating apps that run on windows 10 devices, and can be combined with other platforms. uwp apps can make use of win32 apis and .net classes (see api sets for uwp apps, dlls for uwp apps, and .net for uwp apps).++the microsoft development story continues to evolve, and along with initiatives such as winui, msix, and project reunion, uwp is a powerful tool for creating client apps.++features of a uwp app+a uwp app is:++secure: uwp apps declare which device resources and data they access. the user must authorize that access.+able to use a common api on all devices that run windows 10.+able to use device specific capabilities and adapt the ui to different device screen sizes, resolutions, and dpi.+available from the microsoft store on all devices (or only those that you specify) that run on windows 10. the microsoft store provides multiple ways to make money on your app.+able to be installed and uninstalled without risk to the machine or incurring ""machine rot"".+engaging: use live tiles, push notifications, and user activities that interact with windows timeline and cortana's pick up where i left off, to engage users.+programmable in c#, c++, visual basic, and javascript. for ui, use winui, xaml, html, or directx.+let's look at these in more detail.";++ Assert.AreEqual(expectedResult, viewModel.Text);+ }++ [TestMethod]+ public void UpperCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.UpperCaseCommand.Execute(null);++ string expectedResult+= @"UWP IS ONE OF MANY WAYS TO CREATE CLIENT APPLICATIONS FOR WINDOWS. UWP APPS USE WINRT APIS TO PROVIDE POWERFUL UI AND ADVANCED ASYNCHRONOUS FEATURES THAT ARE IDEAL FOR INTERNET-CONNECTED DEVICES.++TO DOWNLOAD THE TOOLS YOU NEED TO START CREATING UWP APPS, SEE GET SET UP, AND THEN WRITE YOUR FIRST APP.++WHERE DOES UWP FIT IN THE MICROSOFT DEVELOPMENT STORY?+UWP IS ONE CHOICE FOR CREATING APPS THAT RUN ON WINDOWS 10 DEVICES, AND CAN BE COMBINED WITH OTHER PLATFORMS. UWP APPS CAN MAKE USE OF WIN32 APIS AND .NET CLASSES (SEE API SETS FOR UWP APPS, DLLS FOR UWP APPS, AND .NET FOR UWP APPS).++THE MICROSOFT DEVELOPMENT STORY CONTINUES TO EVOLVE, AND ALONG WITH INITIATIVES SUCH AS WINUI, MSIX, AND PROJECT REUNION, UWP IS A POWERFUL TOOL FOR CREATING CLIENT APPS.++FEATURES OF A UWP APP+A UWP APP IS:++SECURE: UWP APPS DECLARE WHICH DEVICE RESOURCES AND DATA THEY ACCESS. THE USER MUST AUTHORIZE THAT ACCESS.+ABLE TO USE A COMMON API ON ALL DEVICES THAT RUN WINDOWS 10.+ABLE TO USE DEVICE SPECIFIC CAPABILITIES AND ADAPT THE UI TO DIFFERENT DEVICE SCREEN SIZES, RESOLUTIONS, AND DPI.+AVAILABLE FROM THE MICROSOFT STORE ON ALL DEVICES (OR ONLY THOSE THAT YOU SPECIFY) THAT RUN ON WINDOWS 10. THE MICROSOFT STORE PROVIDES MULTIPLE WAYS TO MAKE MONEY ON YOUR APP.+ABLE TO BE INSTALLED AND UNINSTALLED WITHOUT RISK TO THE MACHINE OR INCURRING ""MACHINE ROT"".+ENGAGING: USE LIVE TILES, PUSH NOTIFICATIONS, AND USER ACTIVITIES THAT INTERACT WITH WINDOWS TIMELINE AND CORTANA'S PICK UP WHERE I LEFT OFF, TO ENGAGE USERS.+PROGRAMMABLE IN C#, C++, VISUAL BASIC, AND JAVASCRIPT. FOR UI, USE WINUI, XAML, HTML, OR DIRECTX.+LET'S LOOK AT THESE IN MORE DETAIL.";++ Assert.AreEqual(expectedResult, viewModel.Text);+ }++ [TestMethod]+ public void TitleCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.TitleCaseCommand.Execute(null);++ string expectedResult+= @"Uwp Is One Of Many Ways To Create Client Applications For Windows. Uwp Apps Use Winrt Apis To Provide Powerful Ui And Advanced Asynchronous Features That Are Ideal For Internet-Connected Devices.++To Download The Tools You Need To Start Creating Uwp Apps, See Get Set Up, And Then Write Your First App.++Where Does Uwp Fit In The Microsoft Development Story?+Uwp Is One Choice For Creating Apps That Run On Windows 10 Devices, And Can Be Combined With Other Platforms. Uwp Apps Can Make Use Of Win32 Apis And .Net Classes (See Api Sets For Uwp Apps, Dlls For Uwp Apps, And .Net For Uwp Apps).++The Microsoft Development Story Continues To Evolve, And Along With Initiatives Such As Winui, Msix, And Project Reunion, Uwp Is A Powerful Tool For Creating Client Apps.++Features Of A Uwp App+A Uwp App Is:++Secure: Uwp Apps Declare Which Device Resources And Data They Access. The User Must Authorize That Access.+Able To Use A Common Api On All Devices That Run Windows 10.+Able To Use Device Specific Capabilities And Adapt The Ui To Different Device Screen Sizes, Resolutions, And Dpi.+Available From The Microsoft Store On All Devices (Or Only Those That You Specify) That Run On Windows 10. The Microsoft Store Provides Multiple Ways To Make Money On Your App.+Able To Be Installed And Uninstalled Without Risk To The Machine Or Incurring ""Machine Rot"".+Engaging: Use Live Tiles, Push Notifications, And User Activities That Interact With Windows Timeline And Cortana'S Pick Up Where I Left Off, To Engage Users.+Programmable In C#, C++, Visual Basic, And Javascript. For Ui, Use Winui, Xaml, Html, Or Directx.+Let'S Look At These In More Detail.";++ Assert.AreEqual(expectedResult, viewModel.Text);+ }++ [TestMethod]+ public void CamelCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.CamelCaseCommand.Execute(null);++ string expectedResult+= @"uwpIsOneOfManyWaysToCreateClientApplicationsForWindowsUwpAppsUseWinrtApisToProvidePowerfulUiAndAdvancedAsynchronousFeaturesThatAreIdealForInternetConnectedDevices++ToDownloadTheToolsYouNeedToStartCreatingUwpAppsSeeGetSetUpAndThenWriteYourFirstApp++WhereDoesUwpFitInTheMicrosoftDevelopmentStory+UwpIsOneChoiceForCreatingAppsThatRunOnWindows10DevicesAndCanBeCombinedWithOtherPlatformsUwpAppsCanMakeUseOfWin32ApisAndNetClassesSeeApiSetsForUwpAppsDllsForUwpAppsAndNetForUwpApps++TheMicrosoftDevelopmentStoryContinuesToEvolveAndAlongWithInitiativesSuchAsWinuiMsixAndProjectReunionUwpIsAPowerfulToolForCreatingClientApps++FeaturesOfAUwpApp+AUwpAppIs++SecureUwpAppsDeclareWhichDeviceResourcesAndDataTheyAccessTheUserMustAuthorizeThatAccess+AbleToUseACommonApiOnAllDevicesThatRunWindows10+AbleToUseDeviceSpecificCapabilitiesAndAdaptTheUiToDifferentDeviceScreenSizesResolutionsAndDpi+AvailableFromTheMicrosoftStoreOnAllDevicesOrOnlyThoseThatYouSpecifyThatRunOnWindows10TheMicrosoftStoreProvidesMultipleWaysToMakeMoneyOnYourApp+AbleToBeInstalledAndUninstalledWithoutRiskToTheMachineOrIncurringMachineRot+EngagingUseLiveTilesPushNotificationsAndUserActivitiesThatInteractWithWindowsTimelineAndCortanaSPickUpWhereILeftOffToEngageUsers+ProgrammableInCCVisualBasicAndJavascriptForUiUseWinuiXamlHtmlOrDirectx+LetSLookAtTheseInMoreDetail";++ Assert.AreEqual(expectedResult.Replace("\r\n", "\r"), viewModel.Text);+ }++ [TestMethod]+ public void PascalCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.PascalCaseCommand.Execute(null);++ string expectedResult+= @"UwpIsOneOfManyWaysToCreateClientApplicationsForWindowsUwpAppsUseWinrtApisToProvidePowerfulUiAndAdvancedAsynchronousFeaturesThatAreIdealForInternetConnectedDevices++ToDownloadTheToolsYouNeedToStartCreatingUwpAppsSeeGetSetUpAndThenWriteYourFirstApp++WhereDoesUwpFitInTheMicrosoftDevelopmentStory+UwpIsOneChoiceForCreatingAppsThatRunOnWindows10DevicesAndCanBeCombinedWithOtherPlatformsUwpAppsCanMakeUseOfWin32ApisAndNetClassesSeeApiSetsForUwpAppsDllsForUwpAppsAndNetForUwpApps++TheMicrosoftDevelopmentStoryContinuesToEvolveAndAlongWithInitiativesSuchAsWinuiMsixAndProjectReunionUwpIsAPowerfulToolForCreatingClientApps++FeaturesOfAUwpApp+AUwpAppIs++SecureUwpAppsDeclareWhichDeviceResourcesAndDataTheyAccessTheUserMustAuthorizeThatAccess+AbleToUseACommonApiOnAllDevicesThatRunWindows10+AbleToUseDeviceSpecificCapabilitiesAndAdaptTheUiToDifferentDeviceScreenSizesResolutionsAndDpi+AvailableFromTheMicrosoftStoreOnAllDevicesOrOnlyThoseThatYouSpecifyThatRunOnWindows10TheMicrosoftStoreProvidesMultipleWaysToMakeMoneyOnYourApp+AbleToBeInstalledAndUninstalledWithoutRiskToTheMachineOrIncurringMachineRot+EngagingUseLiveTilesPushNotificationsAndUserActivitiesThatInteractWithWindowsTimelineAndCortanaSPickUpWhereILeftOffToEngageUsers+ProgrammableInCCVisualBasicAndJavascriptForUiUseWinuiXamlHtmlOrDirectx+LetSLookAtTheseInMoreDetail";++ Assert.AreEqual(expectedResult.Replace("\r\n", "\r"), viewModel.Text);+ }++ [TestMethod]+ public void SnakeCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.SnakeCaseCommand.Execute(null);++ string expectedResult+= @"uwp_is_one_of_many_ways_to_create_client_applications_for_windows_uwp_apps_use_winrt_apis_to_provide_powerful_ui_and_advanced_asynchronous_features_that_are_ideal_for_internet_connected_devices++to_download_the_tools_you_need_to_start_creating_uwp_apps_see_get_set_up_and_then_write_your_first_app++where_does_uwp_fit_in_the_microsoft_development_story+uwp_is_one_choice_for_creating_apps_that_run_on_windows_10_devices_and_can_be_combined_with_other_platforms_uwp_apps_can_make_use_of_win32_apis_and_net_classes_see_api_sets_for_uwp_apps_dlls_for_uwp_apps_and_net_for_uwp_apps++the_microsoft_development_story_continues_to_evolve_and_along_with_initiatives_such_as_winui_msix_and_project_reunion_uwp_is_a_powerful_tool_for_creating_client_apps++features_of_a_uwp_app+a_uwp_app_is++secure_uwp_apps_declare_which_device_resources_and_data_they_access_the_user_must_authorize_that_access+able_to_use_a_common_api_on_all_devices_that_run_windows_10+able_to_use_device_specific_capabilities_and_adapt_the_ui_to_different_device_screen_sizes_resolutions_and_dpi+available_from_the_microsoft_store_on_all_devices_or_only_those_that_you_specify_that_run_on_windows_10_the_microsoft_store_provides_multiple_ways_to_make_money_on_your_app+able_to_be_installed_and_uninstalled_without_risk_to_the_machine_or_incurring_machine_rot+engaging_use_live_tiles_push_notifications_and_user_activities_that_interact_with_windows_timeline_and_cortana_s_pick_up_where_i_left_off_to_engage_users+programmable_in_c_c_visual_basic_and_javascript_for_ui_use_winui_xaml_html_or_directx+let_s_look_at_these_in_more_detail";++ Assert.AreEqual(expectedResult.Replace("\r\n", "\r"), viewModel.Text);+ }++ [TestMethod]+ public void ConstantCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.ConstantCaseCommand.Execute(null);++ string expectedResult+= @"UWP_IS_ONE_OF_MANY_WAYS_TO_CREATE_CLIENT_APPLICATIONS_FOR_WINDOWS_UWP_APPS_USE_WINRT_APIS_TO_PROVIDE_POWERFUL_UI_AND_ADVANCED_ASYNCHRONOUS_FEATURES_THAT_ARE_IDEAL_FOR_INTERNET_CONNECTED_DEVICES++TO_DOWNLOAD_THE_TOOLS_YOU_NEED_TO_START_CREATING_UWP_APPS_SEE_GET_SET_UP_AND_THEN_WRITE_YOUR_FIRST_APP++WHERE_DOES_UWP_FIT_IN_THE_MICROSOFT_DEVELOPMENT_STORY+UWP_IS_ONE_CHOICE_FOR_CREATING_APPS_THAT_RUN_ON_WINDOWS_10_DEVICES_AND_CAN_BE_COMBINED_WITH_OTHER_PLATFORMS_UWP_APPS_CAN_MAKE_USE_OF_WIN32_APIS_AND_NET_CLASSES_SEE_API_SETS_FOR_UWP_APPS_DLLS_FOR_UWP_APPS_AND_NET_FOR_UWP_APPS++THE_MICROSOFT_DEVELOPMENT_STORY_CONTINUES_TO_EVOLVE_AND_ALONG_WITH_INITIATIVES_SUCH_AS_WINUI_MSIX_AND_PROJECT_REUNION_UWP_IS_A_POWERFUL_TOOL_FOR_CREATING_CLIENT_APPS++FEATURES_OF_A_UWP_APP+A_UWP_APP_IS++SECURE_UWP_APPS_DECLARE_WHICH_DEVICE_RESOURCES_AND_DATA_THEY_ACCESS_THE_USER_MUST_AUTHORIZE_THAT_ACCESS+ABLE_TO_USE_A_COMMON_API_ON_ALL_DEVICES_THAT_RUN_WINDOWS_10+ABLE_TO_USE_DEVICE_SPECIFIC_CAPABILITIES_AND_ADAPT_THE_UI_TO_DIFFERENT_DEVICE_SCREEN_SIZES_RESOLUTIONS_AND_DPI+AVAILABLE_FROM_THE_MICROSOFT_STORE_ON_ALL_DEVICES_OR_ONLY_THOSE_THAT_YOU_SPECIFY_THAT_RUN_ON_WINDOWS_10_THE_MICROSOFT_STORE_PROVIDES_MULTIPLE_WAYS_TO_MAKE_MONEY_ON_YOUR_APP+ABLE_TO_BE_INSTALLED_AND_UNINSTALLED_WITHOUT_RISK_TO_THE_MACHINE_OR_INCURRING_MACHINE_ROT+ENGAGING_USE_LIVE_TILES_PUSH_NOTIFICATIONS_AND_USER_ACTIVITIES_THAT_INTERACT_WITH_WINDOWS_TIMELINE_AND_CORTANA_S_PICK_UP_WHERE_I_LEFT_OFF_TO_ENGAGE_USERS+PROGRAMMABLE_IN_C_C_VISUAL_BASIC_AND_JAVASCRIPT_FOR_UI_USE_WINUI_XAML_HTML_OR_DIRECTX+LET_S_LOOK_AT_THESE_IN_MORE_DETAIL";++ Assert.AreEqual(expectedResult.Replace("\r\n", "\r"), viewModel.Text);+ }++ [TestMethod]+ public void KebabCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.KebabCaseCommand.Execute(null);++ string expectedResult+= @"uwp-is-one-of-many-ways-to-create-client-applications-for-windows-uwp-apps-use-winrt-apis-to-provide-powerful-ui-and-advanced-asynchronous-features-that-are-ideal-for-internet-connected-devices++to-download-the-tools-you-need-to-start-creating-uwp-apps-see-get-set-up-and-then-write-your-first-app++where-does-uwp-fit-in-the-microsoft-development-story+uwp-is-one-choice-for-creating-apps-that-run-on-windows-10-devices-and-can-be-combined-with-other-platforms-uwp-apps-can-make-use-of-win32-apis-and-net-classes-see-api-sets-for-uwp-apps-dlls-for-uwp-apps-and-net-for-uwp-apps++the-microsoft-development-story-continues-to-evolve-and-along-with-initiatives-such-as-winui-msix-and-project-reunion-uwp-is-a-powerful-tool-for-creating-client-apps++features-of-a-uwp-app+a-uwp-app-is++secure-uwp-apps-declare-which-device-resources-and-data-they-access-the-user-must-authorize-that-access+able-to-use-a-common-api-on-all-devices-that-run-windows-10+able-to-use-device-specific-capabilities-and-adapt-the-ui-to-different-device-screen-sizes-resolutions-and-dpi+available-from-the-microsoft-store-on-all-devices-or-only-those-that-you-specify-that-run-on-windows-10-the-microsoft-store-provides-multiple-ways-to-make-money-on-your-app+able-to-be-installed-and-uninstalled-without-risk-to-the-machine-or-incurring-machine-rot+engaging-use-live-tiles-push-notifications-and-user-activities-that-interact-with-windows-timeline-and-cortana-s-pick-up-where-i-left-off-to-engage-users+programmable-in-c-c-visual-basic-and-javascript-for-ui-use-winui-xaml-html-or-directx+let-s-look-at-these-in-more-detail";++ Assert.AreEqual(expectedResult.Replace("\r\n", "\r"), viewModel.Text);+ }++ [TestMethod]+ public void CobolCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.CobolCaseCommand.Execute(null);++ string expectedResult+= @"UWP-IS-ONE-OF-MANY-WAYS-TO-CREATE-CLIENT-APPLICATIONS-FOR-WINDOWS-UWP-APPS-USE-WINRT-APIS-TO-PROVIDE-POWERFUL-UI-AND-ADVANCED-ASYNCHRONOUS-FEATURES-THAT-ARE-IDEAL-FOR-INTERNET-CONNECTED-DEVICES++TO-DOWNLOAD-THE-TOOLS-YOU-NEED-TO-START-CREATING-UWP-APPS-SEE-GET-SET-UP-AND-THEN-WRITE-YOUR-FIRST-APP++WHERE-DOES-UWP-FIT-IN-THE-MICROSOFT-DEVELOPMENT-STORY+UWP-IS-ONE-CHOICE-FOR-CREATING-APPS-THAT-RUN-ON-WINDOWS-10-DEVICES-AND-CAN-BE-COMBINED-WITH-OTHER-PLATFORMS-UWP-APPS-CAN-MAKE-USE-OF-WIN32-APIS-AND-NET-CLASSES-SEE-API-SETS-FOR-UWP-APPS-DLLS-FOR-UWP-APPS-AND-NET-FOR-UWP-APPS++THE-MICROSOFT-DEVELOPMENT-STORY-CONTINUES-TO-EVOLVE-AND-ALONG-WITH-INITIATIVES-SUCH-AS-WINUI-MSIX-AND-PROJECT-REUNION-UWP-IS-A-POWERFUL-TOOL-FOR-CREATING-CLIENT-APPS++FEATURES-OF-A-UWP-APP+A-UWP-APP-IS++SECURE-UWP-APPS-DECLARE-WHICH-DEVICE-RESOURCES-AND-DATA-THEY-ACCESS-THE-USER-MUST-AUTHORIZE-THAT-ACCESS+ABLE-TO-USE-A-COMMON-API-ON-ALL-DEVICES-THAT-RUN-WINDOWS-10+ABLE-TO-USE-DEVICE-SPECIFIC-CAPABILITIES-AND-ADAPT-THE-UI-TO-DIFFERENT-DEVICE-SCREEN-SIZES-RESOLUTIONS-AND-DPI+AVAILABLE-FROM-THE-MICROSOFT-STORE-ON-ALL-DEVICES-OR-ONLY-THOSE-THAT-YOU-SPECIFY-THAT-RUN-ON-WINDOWS-10-THE-MICROSOFT-STORE-PROVIDES-MULTIPLE-WAYS-TO-MAKE-MONEY-ON-YOUR-APP+ABLE-TO-BE-INSTALLED-AND-UNINSTALLED-WITHOUT-RISK-TO-THE-MACHINE-OR-INCURRING-MACHINE-ROT+ENGAGING-USE-LIVE-TILES-PUSH-NOTIFICATIONS-AND-USER-ACTIVITIES-THAT-INTERACT-WITH-WINDOWS-TIMELINE-AND-CORTANA-S-PICK-UP-WHERE-I-LEFT-OFF-TO-ENGAGE-USERS+PROGRAMMABLE-IN-C-C-VISUAL-BASIC-AND-JAVASCRIPT-FOR-UI-USE-WINUI-XAML-HTML-OR-DIRECTX+LET-S-LOOK-AT-THESE-IN-MORE-DETAIL";++ Assert.AreEqual(expectedResult.Replace("\r\n", "\r"), viewModel.Text);+ }++ [TestMethod]+ public void TrainCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.TrainCaseCommand.Execute(null);++ string expectedResult+= @"Uwp-Is-One-Of-Many-Ways-To-Create-Client-Applications-For-Windows-Uwp-Apps-Use-Winrt-Apis-To-Provide-Powerful-Ui-And-Advanced-Asynchronous-Features-That-Are-Ideal-For-Internet-Connected-Devices++To-Download-The-Tools-You-Need-To-Start-Creating-Uwp-Apps-See-Get-Set-Up-And-Then-Write-Your-First-App++Where-Does-Uwp-Fit-In-The-Microsoft-Development-Story+Uwp-Is-One-Choice-For-Creating-Apps-That-Run-On-Windows-10-Devices-And-Can-Be-Combined-With-Other-Platforms-Uwp-Apps-Can-Make-Use-Of-Win32-Apis-And-Net-Classes-See-Api-Sets-For-Uwp-Apps-Dlls-For-Uwp-Apps-And-Net-For-Uwp-Apps++The-Microsoft-Development-Story-Continues-To-Evolve-And-Along-With-Initiatives-Such-As-Winui-Msix-And-Project-Reunion-Uwp-Is-A-Powerful-Tool-For-Creating-Client-Apps++Features-Of-A-Uwp-App+A-Uwp-App-Is++Secure-Uwp-Apps-Declare-Which-Device-Resources-And-Data-They-Access-The-User-Must-Authorize-That-Access+Able-To-Use-A-Common-Api-On-All-Devices-That-Run-Windows-10+Able-To-Use-Device-Specific-Capabilities-And-Adapt-The-Ui-To-Different-Device-Screen-Sizes-Resolutions-And-Dpi+Available-From-The-Microsoft-Store-On-All-Devices-Or-Only-Those-That-You-Specify-That-Run-On-Windows-10-The-Microsoft-Store-Provides-Multiple-Ways-To-Make-Money-On-Your-App+Able-To-Be-Installed-And-Uninstalled-Without-Risk-To-The-Machine-Or-Incurring-Machine-Rot+Engaging-Use-Live-Tiles-Push-Notifications-And-User-Activities-That-Interact-With-Windows-Timeline-And-Cortana-S-Pick-Up-Where-I-Left-Off-To-Engage-Users+Programmable-In-C-C-Visual-Basic-And-Javascript-For-Ui-Use-Winui-Xaml-Html-Or-Directx+Let-S-Look-At-These-In-More-Detail";++ Assert.AreEqual(expectedResult.Replace("\r\n", "\r"), viewModel.Text);+ }++ [TestMethod]+ public void AlterningCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.AlternatingCaseCommand.Execute(null);++ string expectedResult+= @"uWp iS OnE Of mAnY WaYs tO CrEaTe cLiEnT ApPlIcAtIoNs fOr wInDoWs. UwP ApPs uSe wInRt aPiS To pRoViDe pOwErFuL Ui aNd aDvAnCeD AsYnChRoNoUs fEaTuReS ThAt aRe iDeAl fOr iNtErNeT-CoNnEcTeD DeViCeS.++To dOwNlOaD ThE ToOlS YoU NeEd tO StArT CrEaTiNg uWp aPpS, sEe gEt sEt uP, aNd tHeN WrItE YoUr fIrSt aPp.++wHeRe dOeS UwP FiT In tHe mIcRoSoFt dEvElOpMeNt sToRy?+uWp iS OnE ChOiCe fOr cReAtInG ApPs tHaT RuN On wInDoWs 10 DeViCeS, aNd cAn bE CoMbInEd wItH OtHeR PlAtFoRmS. uWp aPpS CaN MaKe uSe oF WiN32 ApIs aNd .NeT ClAsSeS (sEe aPi sEtS FoR UwP ApPs, DlLs fOr uWp aPpS, aNd .NeT FoR UwP ApPs).++ThE MiCrOsOfT DeVeLoPmEnT StOrY CoNtInUeS To eVoLvE, aNd aLoNg wItH InItIaTiVeS SuCh aS WiNuI, mSiX, aNd pRoJeCt rEuNiOn, UwP Is a pOwErFuL ToOl fOr cReAtInG ClIeNt aPpS.++FeAtUrEs oF A UwP ApP+a uWp aPp iS:++SeCuRe: UwP ApPs dEcLaRe wHiCh dEvIcE ReSoUrCeS AnD DaTa tHeY AcCeSs. ThE UsEr mUsT AuThOrIzE ThAt aCcEsS.+AbLe tO UsE A CoMmOn aPi oN AlL DeViCeS ThAt rUn wInDoWs 10.+AbLe tO UsE DeViCe sPeCiFiC CaPaBiLiTiEs aNd aDaPt tHe uI To dIfFeReNt dEvIcE ScReEn sIzEs, ReSoLuTiOnS, aNd dPi.+aVaIlAbLe fRoM ThE MiCrOsOfT StOrE On aLl dEvIcEs (Or oNlY ThOsE ThAt yOu sPeCiFy) ThAt rUn oN WiNdOwS 10. ThE MiCrOsOfT StOrE PrOvIdEs mUlTiPlE WaYs tO MaKe mOnEy oN YoUr aPp.+aBlE To bE InStAlLeD AnD UnInStAlLeD WiThOuT RiSk tO ThE MaChInE Or iNcUrRiNg ""MaChInE RoT"".+eNgAgInG: uSe lIvE TiLeS, pUsH NoTiFiCaTiOnS, aNd uSeR AcTiViTiEs tHaT InTeRaCt wItH WiNdOwS TiMeLiNe aNd cOrTaNa's pIcK Up wHeRe i lEfT OfF, tO EnGaGe uSeRs.+pRoGrAmMaBlE In c#, c++, ViSuAl bAsIc, AnD JaVaScRiPt. FoR Ui, UsE WiNuI, xAmL, hTmL, oR DiReCtX.+LeT'S LoOk aT ThEsE In mOrE DeTaIl.";++ Assert.AreEqual(expectedResult, viewModel.Text);+ }++ [TestMethod]+ public void InverseCase()+ {+ var viewModel = ExportProvider.Import<StringUtilitiesToolViewModel>();++ viewModel.Text = Text;++ viewModel.InverseCaseCommand.Execute(null);++ string expectedResult+= @"UwP Is oNe oF MaNy wAyS To cReAtE ClIeNt aPpLiCaTiOnS FoR WiNdOwS. uWp aPpS UsE WiNrT ApIs tO PrOvIdE PoWeRfUl uI AnD AdVaNcEd aSyNcHrOnOuS FeAtUrEs tHaT ArE IdEaL FoR InTeRnEt-cOnNeCtEd dEvIcEs.++tO DoWnLoAd tHe tOoLs yOu nEeD To sTaRt cReAtInG UwP ApPs, SeE GeT SeT Up, AnD ThEn wRiTe yOuR FiRsT ApP.++WhErE DoEs uWp fIt iN ThE MiCrOsOfT DeVeLoPmEnT StOrY?+UwP Is oNe cHoIcE FoR CrEaTiNg aPpS ThAt rUn oN WiNdOwS 10 dEvIcEs, AnD CaN Be cOmBiNeD WiTh oThEr pLaTfOrMs. UwP ApPs cAn mAkE UsE Of wIn32 aPiS AnD .nEt cLaSsEs (SeE ApI SeTs fOr uWp aPpS, dLlS FoR UwP ApPs, AnD .nEt fOr uWp aPpS).++tHe mIcRoSoFt dEvElOpMeNt sToRy cOnTiNuEs tO EvOlVe, AnD AlOnG WiTh iNiTiAtIvEs sUcH As wInUi, MsIx, AnD PrOjEcT ReUnIoN, uWp iS A PoWeRfUl tOoL FoR CrEaTiNg cLiEnT ApPs.++fEaTuReS Of a uWp aPp+A UwP ApP Is:++sEcUrE: uWp aPpS DeClArE WhIcH DeViCe rEsOuRcEs aNd dAtA ThEy aCcEsS. tHe uSeR MuSt aUtHoRiZe tHaT AcCeSs.+aBlE To uSe a cOmMoN ApI On aLl dEvIcEs tHaT RuN WiNdOwS 10.+aBlE To uSe dEvIcE SpEcIfIc cApAbIlItIeS AnD AdApT ThE Ui tO DiFfErEnT DeViCe sCrEeN SiZeS, rEsOlUtIoNs, AnD DpI.+AvAiLaBlE FrOm tHe mIcRoSoFt sToRe oN AlL DeViCeS (oR OnLy tHoSe tHaT YoU SpEcIfY) tHaT RuN On wInDoWs 10. tHe mIcRoSoFt sToRe pRoViDeS MuLtIpLe wAyS To mAkE MoNeY On yOuR ApP.+AbLe tO Be iNsTaLlEd aNd uNiNsTaLlEd wItHoUt rIsK To tHe mAcHiNe oR InCuRrInG ""mAcHiNe rOt"".+EnGaGiNg: UsE LiVe tIlEs, PuSh nOtIfIcAtIoNs, AnD UsEr aCtIvItIeS ThAt iNtErAcT WiTh wInDoWs tImElInE AnD CoRtAnA'S PiCk uP WhErE I LeFt oFf, To eNgAgE UsErS.+PrOgRaMmAbLe iN C#, C++, vIsUaL BaSiC, aNd jAvAsCrIpT. fOr uI, uSe wInUi, XaMl, HtMl, Or dIrEcTx.+lEt's lOoK At tHeSe iN MoRe dEtAiL.";++ Assert.AreEqual(expectedResult, viewModel.Text);+ }+ }+}