Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added options to Regex Tester tool #42

Merged
merged 3 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions src/dev/impl/DevToys/LanguageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -583,16 +583,96 @@ public class RegExStrings : ObservableObject
{
private readonly ResourceLoader _resources = ResourceLoader.GetForViewIndependentUse("RegEx");

/// <summary>
/// Gets the resource Configuration.
/// </summary>
public string Configuration => _resources.GetString("Configuration");

/// <summary>
/// Gets the resource CultureInvariant.
/// </summary>
public string CultureInvariant => _resources.GetString("CultureInvariant");

/// <summary>
/// Gets the resource CultureInvariantDescription.
/// </summary>
public string CultureInvariantDescription => _resources.GetString("CultureInvariantDescription");

/// <summary>
/// Gets the resource DisplayName.
/// </summary>
public string DisplayName => _resources.GetString("DisplayName");

/// <summary>
/// Gets the resource EcmaScript.
/// </summary>
public string EcmaScript => _resources.GetString("EcmaScript");

/// <summary>
/// Gets the resource EcmaScriptDescription.
/// </summary>
public string EcmaScriptDescription => _resources.GetString("EcmaScriptDescription");

/// <summary>
/// Gets the resource IgnoreCase.
/// </summary>
public string IgnoreCase => _resources.GetString("IgnoreCase");

/// <summary>
/// Gets the resource IgnoreCaseDescription.
/// </summary>
public string IgnoreCaseDescription => _resources.GetString("IgnoreCaseDescription");

/// <summary>
/// Gets the resource IgnoreWhitespace.
/// </summary>
public string IgnoreWhitespace => _resources.GetString("IgnoreWhitespace");

/// <summary>
/// Gets the resource IgnoreWhitespaceDescription.
/// </summary>
public string IgnoreWhitespaceDescription => _resources.GetString("IgnoreWhitespaceDescription");

/// <summary>
/// Gets the resource Multiline.
/// </summary>
public string Multiline => _resources.GetString("Multiline");

/// <summary>
/// Gets the resource MultilineDescription.
/// </summary>
public string MultilineDescription => _resources.GetString("MultilineDescription");

/// <summary>
/// Gets the resource Options.
/// </summary>
public string Options => _resources.GetString("Options");

/// <summary>
/// Gets the resource RegularExpression.
/// </summary>
public string RegularExpression => _resources.GetString("RegularExpression");

/// <summary>
/// Gets the resource RightToLeft.
/// </summary>
public string RightToLeft => _resources.GetString("RightToLeft");

/// <summary>
/// Gets the resource RightToLeftDescription.
/// </summary>
public string RightToLeftDescription => _resources.GetString("RightToLeftDescription");

/// <summary>
/// Gets the resource Singleline.
/// </summary>
public string Singleline => _resources.GetString("Singleline");

/// <summary>
/// Gets the resource SinglelineDescription.
/// </summary>
public string SinglelineDescription => _resources.GetString("SinglelineDescription");

/// <summary>
/// Gets the resource Text.
/// </summary>
Expand Down
48 changes: 48 additions & 0 deletions src/dev/impl/DevToys/Strings/en/RegEx.resw
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,60 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Configuration" xml:space="preserve">
<value>Configuration</value>
</data>
<data name="CultureInvariant" xml:space="preserve">
<value>Culture Invariant</value>
</data>
<data name="CultureInvariantDescription" xml:space="preserve">
<value>Specifies that cultural differences in language is ignored.</value>
</data>
<data name="DisplayName" xml:space="preserve">
<value>Regex Tester</value>
</data>
<data name="EcmaScript" xml:space="preserve">
<value>ECMA Script</value>
</data>
<data name="EcmaScriptDescription" xml:space="preserve">
<value>Enables ECMAScript-compliant behavior for the expression. This value can be used only in conjunction with the Culture Invariant, Ignore Case and Multiline options.</value>
</data>
<data name="IgnoreCase" xml:space="preserve">
<value>Ignore Case</value>
</data>
<data name="IgnoreCaseDescription" xml:space="preserve">
<value>Specifies case-insensitive matching.</value>
</data>
<data name="IgnoreWhitespace" xml:space="preserve">
<value>Ignore Whitespace</value>
</data>
<data name="IgnoreWhitespaceDescription" xml:space="preserve">
<value>Eliminates unescaped white space from the pattern and enables comments marked with #. However, this value does not affect or eliminate white space in character classes, numeric quantifiers, or tokens that mark the beginning of individual regular expression language elements.</value>
</data>
<data name="Multiline" xml:space="preserve">
<value>Multiline</value>
</data>
<data name="MultilineDescription" xml:space="preserve">
<value>Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.</value>
</data>
<data name="Options" xml:space="preserve">
<value>Options</value>
</data>
<data name="RegularExpression" xml:space="preserve">
<value>Regular expression</value>
</data>
<data name="RightToLeft" xml:space="preserve">
<value>Right To Left</value>
</data>
<data name="RightToLeftDescription" xml:space="preserve">
<value>Specifies that the search will be from right to left instead of from left to right.</value>
</data>
<data name="Singleline" xml:space="preserve">
<value>Singleline</value>
</data>
<data name="SinglelineDescription" xml:space="preserve">
<value>Changes the meaning of the dot (.) so it matches every character (instead of every character except \n).</value>
</data>
<data name="Text" xml:space="preserve">
<value>Text</value>
</data>
Expand Down
48 changes: 48 additions & 0 deletions src/dev/impl/DevToys/Strings/fr/RegEx.resw
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,60 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Configuration" xml:space="preserve">
<value>Configuration</value>
</data>
<data name="CultureInvariant" xml:space="preserve">
<value>Culture Indépendente</value>
</data>
<data name="CultureInvariantDescription" xml:space="preserve">
<value>Indique que les différences culturelles dans la langue ne sont pas prises en compte.</value>
</data>
<data name="DisplayName" xml:space="preserve">
<value>Testeur de RegEx</value>
</data>
<data name="EcmaScript" xml:space="preserve">
<value>ECMA Script</value>
</data>
<data name="EcmaScriptDescription" xml:space="preserve">
<value>Active un comportement conforme ECMAScript pour l’expression. Cette valeur ne peut être utilisée qu'en conjonction avec les options Culture Indépendente, Ignorer la Casse et Multiligne.</value>
</data>
<data name="IgnoreCase" xml:space="preserve">
<value>Ignorer la Casse</value>
</data>
<data name="IgnoreCaseDescription" xml:space="preserve">
<value>Spécifie la correspondance qui ne respecte pas la casse.</value>
</data>
<data name="IgnoreWhitespace" xml:space="preserve">
<value>Ignorer les Espaces Blancs</value>
</data>
<data name="IgnoreWhitespaceDescription" xml:space="preserve">
<value>Élimine l'espace blanc sans séquence d'échappement du modèle et active les commentaires marqués avec #. Cependant, cette valeur n’affecte ni n’élimine l’espace blanc dans les classes de caractères, les quantificateurs numériques ou les jetons qui marquent le début d’éléments de langage d’expression régulière.</value>
</data>
<data name="Multiline" xml:space="preserve">
<value>Multiligne</value>
</data>
<data name="MultilineDescription" xml:space="preserve">
<value>Modifie la signification de ^ et $ de sorte qu'ils correspondent respectivement au début et à la fin de n'importe quelle ligne, et non simplement au début et à la fin de la chaîne entière.</value>
</data>
<data name="Options" xml:space="preserve">
<value>Options</value>
</data>
<data name="RegularExpression" xml:space="preserve">
<value>Expression regulière</value>
</data>
<data name="RightToLeft" xml:space="preserve">
<value>Droite à Gauche</value>
</data>
<data name="RightToLeftDescription" xml:space="preserve">
<value>Spécifie que la recherche sera effectuée de droite à gauche et non de gauche à droite.</value>
</data>
<data name="Singleline" xml:space="preserve">
<value>Singleline</value>
</data>
<data name="SinglelineDescription" xml:space="preserve">
<value>Modifie la signification du point (.) de sorte qu'il corresponde à chaque caractère (et non à chaque caractère sauf \n).</value>
</data>
<data name="Text" xml:space="preserve">
<value>Texte</value>
</data>
Expand Down
48 changes: 48 additions & 0 deletions src/dev/impl/DevToys/Strings/ru/RegEx.resw
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,60 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Configuration" xml:space="preserve">
<value>Configuration</value>
</data>
<data name="CultureInvariant" xml:space="preserve">
<value>Culture Invariant</value>
</data>
<data name="CultureInvariantDescription" xml:space="preserve">
<value>Specifies that cultural differences in language is ignored.</value>
</data>
<data name="DisplayName" xml:space="preserve">
<value>Проверка регулярных выражений</value>
</data>
<data name="EcmaScript" xml:space="preserve">
<value>ECMA Script</value>
</data>
<data name="EcmaScriptDescription" xml:space="preserve">
<value>Enables ECMAScript-compliant behavior for the expression. This value can be used only in conjunction with the Culture Invariant, Ignore Case and Multiline options.</value>
</data>
<data name="IgnoreCase" xml:space="preserve">
<value>Ignore Case</value>
</data>
<data name="IgnoreCaseDescription" xml:space="preserve">
<value>Specifies case-insensitive matching.</value>
</data>
<data name="IgnoreWhitespace" xml:space="preserve">
<value>Ignore Whitespace</value>
</data>
<data name="IgnoreWhitespaceDescription" xml:space="preserve">
<value>Eliminates unescaped white space from the pattern and enables comments marked with #. However, this value does not affect or eliminate white space in character classes, numeric quantifiers, or tokens that mark the beginning of individual regular expression language elements.</value>
</data>
<data name="Multiline" xml:space="preserve">
<value>Multiline</value>
</data>
<data name="MultilineDescription" xml:space="preserve">
<value>Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.</value>
</data>
<data name="Options" xml:space="preserve">
<value>Options</value>
</data>
<data name="RegularExpression" xml:space="preserve">
<value>Регулярное выражение</value>
</data>
<data name="RightToLeft" xml:space="preserve">
<value>Right To Left</value>
</data>
<data name="RightToLeftDescription" xml:space="preserve">
<value>Specifies that the search will be from right to left instead of from left to right.</value>
</data>
<data name="Singleline" xml:space="preserve">
<value>Singleline</value>
</data>
<data name="SinglelineDescription" xml:space="preserve">
<value>Changes the meaning of the dot (.) so it matches every character (instead of every character except \n).</value>
</data>
<data name="Text" xml:space="preserve">
<value>Текст</value>
</data>
Expand Down
10 changes: 7 additions & 3 deletions src/dev/impl/DevToys/UI/Controls/ExpandableSettingControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@
xmlns:converters="using:DevToys.UI.Converters"
mc:Ignorable="d"
HorizontalAlignment="Stretch"
CornerRadius="{ThemeResource ControlCornerRadius}"
d:DesignHeight="300"
d:DesignWidth="400">
<UserControl.Resources>
<converters:NullToBooleanConverter x:Key="NullToTrueConverter"/>
<converters:NullToBooleanConverter x:Key="NullToFalseConverter" IsInverted="True"/>

<Style x:Key="GridSettingBlockStyle" TargetType="Grid">
<Setter Property="Background" Value="{ThemeResource ExpanderHeaderBackground}" />
<Setter Property="BorderBrush" Value="{ThemeResource ExpanderHeaderBorderBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource ExpanderHeaderBorderThickness}" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="MinHeight" Value="{StaticResource ExpanderMinHeight}" />
<Setter Property="Padding" Value="{StaticResource ExpanderContentPadding}" />
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
</Style>
</UserControl.Resources>

Expand All @@ -37,6 +36,9 @@
HorizontalContentAlignment="Stretch"
VerticalAlignment="Stretch"
VerticalContentAlignment="Stretch"
Padding="0"
Background="{x:Bind ContentBackground, Mode=OneWay}"
CornerRadius="{x:Bind CornerRadius}"
IsExpanded="{x:Bind IsExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
<muxc:Expander.Header>
<local:ExpandableSettingHeaderControl
Expand All @@ -57,7 +59,9 @@
<Grid
x:Name="NonExpanderGrid"
x:Load="{x:Bind ExpandableContent, Mode=OneWay, Converter={StaticResource NullToTrueConverter}}"
Style="{StaticResource GridSettingBlockStyle}">
Style="{StaticResource GridSettingBlockStyle}"
Background="{x:Bind HeaderBackground, Mode=OneWay}"
CornerRadius="{x:Bind CornerRadius}">
<local:ExpandableSettingHeaderControl
Title="{x:Bind Title, Mode=OneWay}"
Description="{x:Bind Description, Mode=OneWay}"
Expand Down
27 changes: 27 additions & 0 deletions src/dev/impl/DevToys/UI/Controls/ExpandableSettingControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Markup;
using Windows.UI.Xaml.Media;

namespace DevToys.UI.Controls
{
Expand Down Expand Up @@ -76,6 +77,32 @@ public bool IsExpanded
set => SetValue(IsExpandedProperty, value);
}

public static readonly DependencyProperty ContentBackgroundProperty
= DependencyProperty.Register(
nameof(ContentBackground),
typeof(Brush),
typeof(ExpandableSettingControl),
new PropertyMetadata(Application.Current.Resources["ExpanderContentBackground"]));

public Brush ContentBackground
{
get => (Brush)GetValue(ContentBackgroundProperty);
set => SetValue(ContentBackgroundProperty, value);
}

public static readonly DependencyProperty HeaderBackgroundProperty
= DependencyProperty.Register(
nameof(HeaderBackground),
typeof(Brush),
typeof(ExpandableSettingControl),
new PropertyMetadata(Application.Current.Resources["ExpanderHeaderBackground"]));

public Brush HeaderBackground
{
get => (Brush)GetValue(HeaderBackgroundProperty);
set => SetValue(HeaderBackgroundProperty, value);
}

public ExpandableSettingControl()
{
InitializeComponent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<ContentPresenter
x:Name="SettingIconElement"
Margin="2,0,20,0"
x:Load="{x:Bind Icon, Mode=OneWay, Converter={StaticResource NullToFalseConverter}}"
Width="20"
Content="{x:Bind Icon, Mode=OneWay}" />

<Grid
Expand Down
Loading