From b576c0ce8162a11b4585496c30d2d78ef71a3fd1 Mon Sep 17 00:00:00 2001 From: heartacker Date: Fri, 22 Mar 2024 21:51:24 +0800 Subject: [PATCH] =?UTF-8?q?dotnet=208,=E4=BB=A5=E4=B8=8A=E6=89=8D=E6=9C=89?= =?UTF-8?q?=20=E8=BF=99=E4=B8=AAbin=20=E7=9A=84=E6=9E=9A=E4=B8=BE=20https:?= =?UTF-8?q?//learn.microsoft.com/zh-cn/dotnet/api/system.globalization.num?= =?UTF-8?q?berstyles=3Fview=3Dnet-8.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Ursa/Controls/NumericUpDown/NumericUpDownBase.cs | 7 ++++++- src/Ursa/Ursa.csproj | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Ursa/Controls/NumericUpDown/NumericUpDownBase.cs b/src/Ursa/Controls/NumericUpDown/NumericUpDownBase.cs index ac846cb..598324f 100644 --- a/src/Ursa/Controls/NumericUpDown/NumericUpDownBase.cs +++ b/src/Ursa/Controls/NumericUpDown/NumericUpDownBase.cs @@ -356,7 +356,12 @@ public abstract class NumericUpDownBase : 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 { diff --git a/src/Ursa/Ursa.csproj b/src/Ursa/Ursa.csproj index 448ddec..1b93c54 100644 --- a/src/Ursa/Ursa.csproj +++ b/src/Ursa/Ursa.csproj @@ -3,7 +3,7 @@ - netstandard2.0 + netstandard2.0;NET8 enable enable latest