提交 841f9c81 编写于 作者: B Brett V. Forsgren 提交者: GitHub

Remove another pattern match.

上级 8fa08170
using System.Globalization;
using System.Globalization;
using System.Windows.Controls;
namespace Microsoft.VisualStudio.FSharp.UIResources
......@@ -20,7 +21,8 @@ public override ValidationResult Validate(object value, CultureInfo cultureInfo)
if (value is string)
{
var text = (string)value;
if (int.TryParse(text, out int i) &&
int i = 0;
if (int.TryParse(text, out i) &&
i >= Min && i <= Max)
{
return ValidationResult.ValidResult;
......@@ -30,4 +32,4 @@ public override ValidationResult Validate(object value, CultureInfo cultureInfo)
return new ValidationResult(false, $"Expected a number between {Min} and {Max}");
}
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册