summaryrefslogtreecommitdiff
path: root/Gestor.Common/Gestor.Common.Validation/ValidacaoLong.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Gestor.Common/Gestor.Common.Validation/ValidacaoLong.cs')
-rw-r--r--Gestor.Common/Gestor.Common.Validation/ValidacaoLong.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/Gestor.Common/Gestor.Common.Validation/ValidacaoLong.cs b/Gestor.Common/Gestor.Common.Validation/ValidacaoLong.cs
new file mode 100644
index 0000000..b60823a
--- /dev/null
+++ b/Gestor.Common/Gestor.Common.Validation/ValidacaoLong.cs
@@ -0,0 +1,18 @@
+using System.Globalization;
+using System.Windows.Controls;
+
+namespace Gestor.Common.Validation;
+
+public class ValidacaoLong : ValidationRule
+{
+ public override ValidationResult Validate(object value, CultureInfo cultureInfo)
+ {
+ //IL_002f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0035: Expected O, but got Unknown
+ if (string.IsNullOrWhiteSpace((value ?? "").ToString()) || value.ToString().ValidateLong())
+ {
+ return ValidationResult.ValidResult;
+ }
+ return new ValidationResult(false, (object)"Número Inválido");
+ }
+}