mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Display conditions - Implemented expression tree creation
Display conditions - Use the most appropriate number input UI general - Use current localisation for decimal seperators and enfore in inputs
This commit is contained in:
1 parent
b869078f08
commit
3da2fbcf0a
21 files changed
+282
-131
No files matched your search
@@ -1,8 +1,8 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Input;
|
||||
using Artemis.Core.Plugins.Abstract.DataModels.Attributes;
|
||||
using Artemis.UI.Shared.DataModelVisualization;
|
||||
using FluentValidation.TestHelper;
|
||||
|
||||
namespace Artemis.UI.DataModelVisualization.Input
|
||||
{
|
||||
@@ -14,7 +14,8 @@ namespace Artemis.UI.DataModelVisualization.Input
|
||||
|
||||
public void NumberValidationTextBox(object sender, TextCompositionEventArgs e)
|
||||
{
|
||||
var regex = new Regex("^[.|,][0-9]+$|^[0-9]*[.|,]{0,1}[0-9]*$");
|
||||
var seperator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
|
||||
var regex = new Regex("^["+ seperator + "][0-9]+$|^[0-9]*["+ seperator + "]{0,1}[0-9]*$");
|
||||
e.Handled = !regex.IsMatch(e.Text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Input;
|
||||
using Artemis.Core.Plugins.Abstract.DataModels.Attributes;
|
||||
using Artemis.UI.Shared.DataModelVisualization;
|
||||
@@ -17,10 +16,5 @@ namespace Artemis.UI.DataModelVisualization.Input
|
||||
var regex = new Regex("[^0-9]+");
|
||||
e.Handled = regex.IsMatch(e.Text);
|
||||
}
|
||||
|
||||
protected override int ConvertToSupportedType(object source)
|
||||
{
|
||||
return Convert.ToInt32(source);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user