From 8c0dbcf1f4507af29517dccebff5289c42e9b477 Mon Sep 17 00:00:00 2001 From: nsnail Date: Thu, 28 Sep 2023 10:26:05 +0800 Subject: [PATCH] Tk (#2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * * 1.0.7 * * * * * * * + Unicode,UnicodeDe * * * bugfix * 从资源文件读取Description * 从资源文件读取Description-可继承 * 将一个对象序列化成json文本 * * 调整一下日志格式 * feat: * 泛型特性本地化资源描述 * 添加测试项目 * * feat: enum、string * feat: long 类型增加rand方法 * feat: ToInvString * fix: ToInvString * fix: ToInvString * fix: ParameterFormat bug * [BLD] [SKIP CI] * [BLD] [SKIP CI] --- publish.ps1 | 6 ++++++ src/NSExt/Attributes/LocalizationAttribute.cs | 2 ++ src/NSExt/Attributes/ResourceDescriptionAttribute.cs | 2 ++ src/NSExt/Extensions/StreamExtensions.cs | 2 ++ src/NSExt/NSExt.csproj | 2 +- 5 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 publish.ps1 diff --git a/publish.ps1 b/publish.ps1 new file mode 100644 index 0000000..a890466 --- /dev/null +++ b/publish.ps1 @@ -0,0 +1,6 @@ +Remove-Item ./dist -Recurse -Force -Confirm:$false +dotnet build -c Release +$apikey = Read-Host -Prompt "nuget apikey" +foreach ($file in Get-ChildItem -Path ./dist/NSExt/bin/Release | Where-Object { $_.Name -match "nupkg" }) { + dotnet nuget push $file --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json +} \ No newline at end of file diff --git a/src/NSExt/Attributes/LocalizationAttribute.cs b/src/NSExt/Attributes/LocalizationAttribute.cs index 9b53058..4c157a8 100644 --- a/src/NSExt/Attributes/LocalizationAttribute.cs +++ b/src/NSExt/Attributes/LocalizationAttribute.cs @@ -9,7 +9,9 @@ public sealed class LocalizationAttribute : Attribute /// /// Initializes a new instance of the class. /// + #pragma warning disable IDE0290 public LocalizationAttribute(Type resourceClass) + #pragma warning restore IDE0290 { ResourceClass = resourceClass; } diff --git a/src/NSExt/Attributes/ResourceDescriptionAttribute.cs b/src/NSExt/Attributes/ResourceDescriptionAttribute.cs index f124234..c2e4386 100644 --- a/src/NSExt/Attributes/ResourceDescriptionAttribute.cs +++ b/src/NSExt/Attributes/ResourceDescriptionAttribute.cs @@ -9,7 +9,9 @@ public sealed class ResourceDescriptionAttribute : Attribute /// /// Initializes a new instance of the class. /// + #pragma warning disable IDE0290 public ResourceDescriptionAttribute(string resourceName) + #pragma warning restore IDE0290 { ResourceName = resourceName; } diff --git a/src/NSExt/Extensions/StreamExtensions.cs b/src/NSExt/Extensions/StreamExtensions.cs index 74fc642..0c8e61e 100644 --- a/src/NSExt/Extensions/StreamExtensions.cs +++ b/src/NSExt/Extensions/StreamExtensions.cs @@ -25,6 +25,8 @@ public static long FirstByteIndex(this Stream me, byte[] findBytes) /// public static bool IsTextStream(this Stream me) { + #pragma warning disable IDE0300 return me.FirstByteIndex(new byte[] { 0x00, 0xff }) < 0; + #pragma warning restore IDE0300 } } \ No newline at end of file diff --git a/src/NSExt/NSExt.csproj b/src/NSExt/NSExt.csproj index 51325b9..22c816d 100644 --- a/src/NSExt/NSExt.csproj +++ b/src/NSExt/NSExt.csproj @@ -2,7 +2,7 @@ - +