dotnet 8,以上才有 这个bin 的枚举

https://learn.microsoft.com/zh-cn/dotnet/api/system.globalization.numberstyles?view=net-8.0
This commit is contained in:
heartacker
2024-03-22 21:51:24 +08:00
parent e8fcb72fc2
commit b576c0ce81
2 changed files with 7 additions and 2 deletions

View File

@@ -356,7 +356,12 @@ public abstract class NumericUpDownBase<T> : NumericUpDown where T : struct, ICo
text = text.Substring(1);
}
}
else if (((int)numberStyles &/* NumberStyles.AllowBinarySpecifier */ 1027) != 0)
else
#if NET8_0_OR_GREATER
if ((numberStyles & NumberStyles.AllowBinarySpecifier) != 0)
#else
if (((int)numberStyles &/* NumberStyles.AllowBinarySpecifier */ 1027) != 0)
#endif
{
if (text.StartsWith("0b") || text.StartsWith("0B")) // support 0b bin while user input
{

View File

@@ -3,7 +3,7 @@
<Import Project="../Package.props"/>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;NET8</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>