提交 0e3effd7 编写于 作者: B Brett V. Forsgren 提交者: GitHub

Merge pull request #3346 from brettfo/remote-pattern-match

remove pattern match
......@@ -55,7 +55,7 @@
<Compile Include="CodeFixesOptionControl.xaml.cs">
<DependentUpon>CodeFixesOptionControl.xaml</DependentUpon>
</Compile>
<Compile Include="IntergerCheckValidationRule.cs" />
<Compile Include="IntegerRangeValidationRule.cs" />
<Compile Include="LanguageServicePerformanceOptionControl.xaml.cs">
<DependentUpon>LanguageServicePerformanceOptionControl.xaml</DependentUpon>
</Compile>
......
......@@ -17,8 +17,9 @@ public IntegerRangeValidationRule()
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
{
if (value is string text)
if (value is string)
{
var text = (string)value;
if (int.TryParse(text, out int i) &&
i >= Min && i <= Max)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册