mirror of
https://github.com/nsnail/ns-ext.git
synced 2025-04-20 00:42:51 +08:00
Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c9975472bf | ||
![]() |
97c93bd854 | ||
![]() |
322cbc32df | ||
![]() |
fa84cc315b | ||
![]() |
d4a92aca6f | ||
![]() |
a9f3416c37 | ||
![]() |
890b229683 | ||
c3c6819a99 | |||
![]() |
efa6a564dc | ||
7c5b5443cb | |||
![]() |
689d9560a8 | ||
![]() |
49de51d649 | ||
6676323b26 | |||
![]() |
c7c978fe5c | ||
![]() |
892df78c26 | ||
![]() |
7a1c8db6e4 | ||
![]() |
2b6c7adff8 | ||
4c515ac127 | |||
![]() |
b32fe597dd | ||
![]() |
7557cb0538 | ||
44c30a2147 | |||
0e8319771e | |||
![]() |
32b7bdf700 | ||
41208a5d7f | |||
![]() |
301154a66c | ||
![]() |
bca2b60636 | ||
![]() |
3de9d3b8d0 | ||
![]() |
ddf07fce57 | ||
![]() |
00164b02d9 |
@ -64,7 +64,7 @@ module.exports = {
|
|||||||
maxSubjectLength: Infinity,
|
maxSubjectLength: Infinity,
|
||||||
minSubjectLength: 0,
|
minSubjectLength: 0,
|
||||||
scopeOverrides: undefined,
|
scopeOverrides: undefined,
|
||||||
defaultBody: '',
|
defaultBody: '[skip ci]',
|
||||||
defaultIssues: '',
|
defaultIssues: '',
|
||||||
defaultScope: '',
|
defaultScope: '',
|
||||||
defaultSubject: ''
|
defaultSubject: ''
|
||||||
|
@ -1,56 +1,63 @@
|
|||||||
|
# 此文件为 EditorConfig 配置文件,用于设置跨编辑器的代码格式化规则。
|
||||||
|
# root = true 表示此文件是根配置文件。
|
||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8 # 文件字符集为 UTF-8
|
||||||
end_of_line = lf
|
end_of_line = lf # 行结束符为 LF
|
||||||
ij_xml_attribute_wrap = off
|
ij_xml_attribute_wrap = off # IntelliJ IDEA 中 XML 属性不换行
|
||||||
ij_xml_text_wrap = off
|
ij_xml_text_wrap = off # IntelliJ IDEA 中 XML 文本不换行
|
||||||
indent_size = 4
|
indent_size = 4 # 缩进大小为 4 个空格
|
||||||
indent_style = space
|
indent_style = space # 使用空格进行缩进
|
||||||
insert_final_newline = false
|
insert_final_newline = false # 不在文件末尾插入空行
|
||||||
trim_trailing_whitespace = true
|
max_line_length = 150 # 行长度限制为 150 个字符
|
||||||
|
trim_trailing_whitespace = true # 删除行尾的空格
|
||||||
|
|
||||||
[{*.json,*.yml}]
|
[{*.json,*.yml}]
|
||||||
indent_size = 2
|
indent_size = 2 # 对于 JSON 和 YAML 文件,缩进大小为 2 个空格
|
||||||
|
|
||||||
[*.cs]
|
[*.cs]
|
||||||
dotnet_analyzer_diagnostic.severity = warning
|
dotnet_analyzer_diagnostic.severity = warning # 设置 C# 文件中所有 dotnet_analyzer_diagnostic 的严重性级别为 warning
|
||||||
|
|
||||||
|
[*.g.cs]
|
||||||
|
dotnet_analyzer_diagnostic.severity = none # 禁用所有代码分析规则
|
||||||
|
|
||||||
|
|
||||||
# ReSharper properties
|
# ReSharper properties
|
||||||
resharper_align_linq_query = true
|
resharper_align_linq_query = true # 启用对LINQ查询的对齐
|
||||||
resharper_align_multiline_argument = true
|
resharper_align_multiline_argument = true # 启用多行参数的对齐
|
||||||
resharper_align_multiline_array_and_object_initializer = true
|
resharper_align_multiline_array_and_object_initializer = true # 启用多行数组和对象初始化器的对齐
|
||||||
resharper_align_multiline_binary_patterns = true
|
resharper_align_multiline_binary_patterns = true # 启用多行二元模式的对齐
|
||||||
resharper_align_multiline_calls_chain = true
|
resharper_align_multiline_calls_chain = true # 启用多行调用链的对齐
|
||||||
resharper_align_multiline_extends_list = true
|
resharper_align_multiline_extends_list = true # 启用多行扩展列表的对齐
|
||||||
resharper_align_multiline_parameter = true
|
resharper_align_multiline_parameter = true # 启用多行参数的对齐
|
||||||
resharper_align_multiline_property_pattern = true
|
resharper_align_multiline_property_pattern = true # 启用多行属性模式的对齐
|
||||||
resharper_align_multiline_switch_expression = true
|
resharper_align_multiline_switch_expression = true # 启用多行切换表达式的对齐
|
||||||
resharper_align_multiple_declaration = true
|
resharper_align_multiple_declaration = true # 启用多个声明的对齐
|
||||||
resharper_align_multline_type_parameter_constrains = true
|
resharper_align_multline_type_parameter_constrains = true # 启用多行类型参数约束的对齐
|
||||||
resharper_align_multline_type_parameter_list = true
|
resharper_align_multline_type_parameter_list = true # 启用多行类型参数列表的对齐
|
||||||
resharper_align_tuple_components = true
|
resharper_align_tuple_components = true # 启用元组组件的对齐
|
||||||
resharper_allow_comment_after_lbrace = true
|
resharper_allow_comment_after_lbrace = true # 允许在大括号前添加注释
|
||||||
resharper_blank_lines_before_single_line_comment = 1
|
resharper_blank_lines_before_single_line_comment = 1 # 在单行注释前添加空行
|
||||||
resharper_csharp_empty_block_style = together_same_line
|
resharper_csharp_empty_block_style = together_same_line # 设置空块的样式为“在一起,在同一行”
|
||||||
resharper_csharp_outdent_commas = true
|
resharper_csharp_outdent_commas = true # 是否将逗号后的代码退缩
|
||||||
resharper_csharp_place_type_constraints_on_same_line = false
|
resharper_csharp_place_type_constraints_on_same_line = false # 在类型约束上是否保持在同一行
|
||||||
resharper_csharp_stick_comment = false
|
resharper_csharp_stick_comment = false # 是否将注释粘贴在代码行的末尾
|
||||||
resharper_csharp_wrap_before_comma = true
|
resharper_csharp_wrap_before_comma = true # 在逗号前是否添加换行
|
||||||
resharper_indent_nested_for_stmt = true
|
resharper_indent_nested_for_stmt = true # 是否对嵌套的for语句进行缩进
|
||||||
resharper_indent_nested_foreach_stmt = true
|
resharper_indent_nested_foreach_stmt = true # 是否对嵌套的foreach语句进行缩进
|
||||||
resharper_indent_nested_while_stmt = true
|
resharper_indent_nested_while_stmt = true # 是否对嵌套的while语句进行缩进
|
||||||
resharper_indent_preprocessor_if = usual_indent
|
resharper_indent_preprocessor_if = usual_indent # 设置预处理器指令`if`的缩进方式
|
||||||
resharper_indent_preprocessor_other = usual_indent
|
resharper_indent_preprocessor_other = usual_indent # 设置其他预处理器指令的缩进方式
|
||||||
resharper_int_align = true
|
resharper_int_align = true # 启用整数对齐
|
||||||
resharper_keep_existing_arrangement = false
|
resharper_keep_existing_arrangement = false # 在重新排列时是否保留现有的布局
|
||||||
resharper_place_linq_into_on_new_line = false
|
resharper_place_linq_into_on_new_line = false # 是否将LINQ表达式放在新行
|
||||||
resharper_place_simple_embedded_statement_on_same_line = false
|
resharper_place_simple_embedded_statement_on_same_line = false # 是否将简单的嵌入式语句放在同一行
|
||||||
resharper_place_simple_switch_expression_on_single_line = true
|
resharper_place_simple_switch_expression_on_single_line = true # 是否将简单的切换表达式放在单行
|
||||||
resharper_wrap_before_eq = true
|
resharper_wrap_before_eq = true # 在等号前是否添加换行
|
||||||
resharper_wrap_chained_method_calls = chop_if_long
|
resharper_wrap_chained_method_calls = chop_if_long # 是否拆分链式方法调用
|
||||||
resharper_wrap_switch_expression = chop_if_long
|
resharper_wrap_switch_expression = chop_if_long # 是否拆分切换表达式
|
||||||
|
|
||||||
# Microsoft .NET properties
|
# Microsoft .NET properties
|
||||||
csharp_indent_braces = false
|
csharp_indent_braces = false # 设置为false表示花括号不跟随代码行缩进
|
||||||
csharp_new_line_before_open_brace = local_functions, methods, types
|
csharp_new_line_before_open_brace = local_functions, methods, types # 这里设置为local_functions, methods, types,表示在局部函数、方法和类型定义的开放花括号前应换行
|
1
.github/workflows/README.md
vendored
Normal file
1
.github/workflows/README.md
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
github workflows
|
@ -13,13 +13,11 @@ jobs:
|
|||||||
filter: tree:0
|
filter: tree:0
|
||||||
- uses: actions/setup-dotnet@v3
|
- uses: actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: 8.0.x
|
dotnet-version: 9.0.x
|
||||||
- working-directory: ./src/backend/NSExt
|
|
||||||
run: dotnet build -c Release -f net6.0
|
|
||||||
- working-directory: ./src/backend/NSExt
|
|
||||||
run: dotnet build -c Release -f net7.0
|
|
||||||
- working-directory: ./src/backend/NSExt
|
- working-directory: ./src/backend/NSExt
|
||||||
run: dotnet build -c Release -f net8.0
|
run: dotnet build -c Release -f net8.0
|
||||||
|
- working-directory: ./src/backend/NSExt
|
||||||
|
run: dotnet build -c Release -f net9.0
|
||||||
- working-directory: ./src/backend/NSExt
|
- working-directory: ./src/backend/NSExt
|
||||||
run: dotnet pack -c Release --no-build
|
run: dotnet pack -c Release --no-build
|
||||||
- uses: actions/create-release@v1
|
- uses: actions/create-release@v1
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -55,7 +55,7 @@ nunit-*.xml
|
|||||||
dlldata.c
|
dlldata.c
|
||||||
|
|
||||||
# Benchmark Results
|
# Benchmark Results
|
||||||
BenchmarkNSExtNet.Artifacts/
|
BenchmarkDotNet.Artifacts/
|
||||||
|
|
||||||
# .NET Core
|
# .NET Core
|
||||||
project.lock.json
|
project.lock.json
|
||||||
@ -130,12 +130,12 @@ $tf/
|
|||||||
# ReSharper is a .NET coding add-in
|
# ReSharper is a .NET coding add-in
|
||||||
_ReSharper*/
|
_ReSharper*/
|
||||||
*.[Rr]e[Ss]harper
|
*.[Rr]e[Ss]harper
|
||||||
*.NSExtSettings.user
|
*.DotSettings.user
|
||||||
|
|
||||||
# TeamCity is a build add-in
|
# TeamCity is a build add-in
|
||||||
_TeamCity*
|
_TeamCity*
|
||||||
|
|
||||||
# NSExtCover is a Code Coverage Tool
|
# DotCover is a Code Coverage Tool
|
||||||
*.dotCover
|
*.dotCover
|
||||||
|
|
||||||
# AxoCover is a Code Coverage Tool
|
# AxoCover is a Code Coverage Tool
|
||||||
|
42
CHANGELOG.md
42
CHANGELOG.md
@ -2,6 +2,48 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [2.3.5](https://github.com/nsnail/NSExt/compare/v2.3.2...v2.3.5) (2025-03-26)
|
||||||
|
|
||||||
|
### [2.3.4](https://github.com/nsnail/NSExt/compare/v2.3.2...v2.3.4) (2025-03-06)
|
||||||
|
|
||||||
|
### [2.3.3](https://github.com/nsnail/NSExt/compare/v2.3.2...v2.3.3) (2025-01-02)
|
||||||
|
|
||||||
|
### [2.3.2](https://github.com/nsnail/NSExt/compare/v2.3.1...v2.3.2) (2024-11-25)
|
||||||
|
|
||||||
|
### [2.3.1](https://github.com/nsnail/NSExt/compare/v2.3.0...v2.3.1) (2024-11-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 a stable release of a package should not have a prerelease dependency ([#27](https://github.com/nsnail/NSExt/issues/27)) ([689d956](https://github.com/nsnail/NSExt/commit/689d9560a858c0ac308ec198b041fdc23720beba))
|
||||||
|
|
||||||
|
## [2.3.0](https://github.com/nsnail/NSExt/compare/v2.2.1...v2.3.0) (2024-11-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* ✨ 新增一些扩展方法 ([#25](https://github.com/nsnail/NSExt/issues/25)) ([c7c978f](https://github.com/nsnail/NSExt/commit/c7c978fe5cf931e085e40ad1347bdb3f3450dd0a))
|
||||||
|
|
||||||
|
### [2.2.2](https://github.com/nsnail/NSExt/compare/v2.2.1...v2.2.2) (2024-11-25)
|
||||||
|
|
||||||
|
### [2.2.1](https://github.com/nsnail/NSExt/compare/v2.2.0...v2.2.1) (2024-11-25)
|
||||||
|
|
||||||
|
## [2.2.0](https://github.com/nsnail/NSExt/compare/v2.1.0...v2.2.0) (2024-07-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* ✨ 新增string扩展函数 IsJsonString ([41208a5](https://github.com/nsnail/NSExt/commit/41208a5d7f63ad595ec985d3616fbce2c9bdc4d0))
|
||||||
|
* ✨ 新增string扩展函数 IsJsonString ([#19](https://github.com/nsnail/NSExt/issues/19)) ([32b7bdf](https://github.com/nsnail/NSExt/commit/32b7bdf700f694fec7f5dcef43dc05244dcd02d5))
|
||||||
|
* ✨ 异步累加器函数 ([#17](https://github.com/nsnail/NSExt/issues/17)) ([3de9d3b](https://github.com/nsnail/NSExt/commit/3de9d3b8d06143c93c9acad43df22eb09242ac29))
|
||||||
|
|
||||||
|
## [2.1.0](https://github.com/nsnail/NSExt/compare/v2.0.11...v2.1.0) (2024-03-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* ✨ 异步累加器函数 ([ddf07fc](https://github.com/nsnail/NSExt/commit/ddf07fce5732e576db1512f870196c20f7b297e2))
|
||||||
|
|
||||||
### [2.0.11](https://github.com/nsnail/NSExt/compare/v2.0.10...v2.0.11) (2023-12-15)
|
### [2.0.11](https://github.com/nsnail/NSExt/compare/v2.0.10...v2.0.11) (2023-12-15)
|
||||||
|
|
||||||
### [2.0.10](https://github.com/nsnail/NSExt/compare/v2.0.9...v2.0.10) (2023-12-14)
|
### [2.0.10](https://github.com/nsnail/NSExt/compare/v2.0.9...v2.0.10) (2023-12-14)
|
@ -17,16 +17,16 @@
|
|||||||
<LangVersion>preview</LangVersion>
|
<LangVersion>preview</LangVersion>
|
||||||
<MinVerDefaultPreReleaseIdentifiers>beta</MinVerDefaultPreReleaseIdentifiers>
|
<MinVerDefaultPreReleaseIdentifiers>beta</MinVerDefaultPreReleaseIdentifiers>
|
||||||
<MinVerTagPrefix>v</MinVerTagPrefix>
|
<MinVerTagPrefix>v</MinVerTagPrefix>
|
||||||
<NoWarn>CA1707;IDE0005;IDE0008;IDE0010;IDE0028;IDE0055;IDE0160;IDE0300;IDE0305;RCS1141;RCS1142;RCS1181;S101;S1121;S1135;S125;S2094;S3604;S4663;SYSLIB1045;SA1010;RCS1123;SA1407;IDE0048;S1075;S3928</NoWarn>
|
<NoWarn>CA1707;CA1720;CA5350;CA5351;IDE0005;IDE0008;IDE0010;IDE0028;IDE0048;IDE0055;IDE0160;IDE0300;IDE0305;RCS1123;RCS1141;RCS1142;RCS1181;S101;S1075;S1121;S1135;S125;S2094;S3604;S3928;S4663;SA1010;SA1407;SYSLIB1045</NoWarn>
|
||||||
<Product>NSExt</Product>
|
<Product>NSExt</Product>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<RepositoryUrl>https://github.com/nsnail/NSExt.git</RepositoryUrl>
|
<RepositoryUrl>https://github.com/nsnail/NSExt.git</RepositoryUrl>
|
||||||
<RootNamespace>NSExt</RootNamespace>
|
<RootNamespace>NSExt</RootNamespace>
|
||||||
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
|
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
|
||||||
<Title>$(AssemblyName)</Title>
|
<Title>$(AssemblyName)</Title>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MinVer" Version="5.0.0-beta.1">
|
<PackageReference Include="MinVer" Version="6.1.0-beta.1">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
@ -31,9 +31,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B
|
|||||||
1.git.pull.request.ps1 = scripts/1.git.pull.request.ps1
|
1.git.pull.request.ps1 = scripts/1.git.pull.request.ps1
|
||||||
2.git.release.ps1 = scripts/2.git.release.ps1
|
2.git.release.ps1 = scripts/2.git.release.ps1
|
||||||
3.git.recreate.branch.ps1 = scripts/3.git.recreate.branch.ps1
|
3.git.recreate.branch.ps1 = scripts/3.git.recreate.branch.ps1
|
||||||
|
4.git.del.obsolete.tags.ps1 = scripts/4.git.del.obsolete.tags.ps1
|
||||||
clean.ln.csx = scripts/clean.ln.csx
|
clean.ln.csx = scripts/clean.ln.csx
|
||||||
code.clean.csx = scripts/code.clean.csx
|
code.clean.csx = scripts/code.clean.csx
|
||||||
code.clean.ps1 = scripts/code.clean.ps1
|
code.clean.ps1 = scripts/code.clean.ps1
|
||||||
|
find.unused.ln.csx = scripts/find.unused.ln.csx
|
||||||
gen.cs.tt = scripts/gen.cs.tt
|
gen.cs.tt = scripts/gen.cs.tt
|
||||||
gen.ln.cmd = scripts/gen.ln.cmd
|
gen.ln.cmd = scripts/gen.ln.cmd
|
||||||
gen.resx.tt = scripts/gen.resx.tt
|
gen.resx.tt = scripts/gen.resx.tt
|
||||||
@ -41,8 +43,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B
|
|||||||
install.as.tpl.ps1 = scripts/install.as.tpl.ps1
|
install.as.tpl.ps1 = scripts/install.as.tpl.ps1
|
||||||
rename.csx = scripts/rename.csx
|
rename.csx = scripts/rename.csx
|
||||||
resharper.full.ps1 = scripts/resharper.full.ps1
|
resharper.full.ps1 = scripts/resharper.full.ps1
|
||||||
switcher.nsext.json = scripts/switcher.nsext.json
|
switch.nuget.or.project.csx = scripts/switch.nuget.or.project.csx
|
||||||
switcher.ps1 = scripts/switcher.ps1
|
|
||||||
sync.sln.files.csx = scripts/sync.sln.files.csx
|
sync.sln.files.csx = scripts/sync.sln.files.csx
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
@ -50,7 +51,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{1129
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3C6F049E-3EE8-4D66-9AFF-E8A369032487}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3C6F049E-3EE8-4D66-9AFF-E8A369032487}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
ci.yml = .github/workflows/ci.yml
|
README.md = .github/workflows/README.md
|
||||||
|
release.yml = .github/workflows/release.yml
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8E4C93BA-9493-4892-80C4-5E174C504829}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8E4C93BA-9493-4892-80C4-5E174C504829}"
|
||||||
|
@ -1,58 +1,38 @@
|
|||||||
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml:space="preserve">
|
||||||
xmlns:s="clr-namespace:System;assembly=mscorlib"
|
<!-- CodeEditing-->
|
||||||
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml:space="preserve">
|
<s:Boolean x:Key="/Default/CodeEditing/TypingAssist/SkipClosingBracesOnTabInStringLiterals/@EntryValue">True</s:Boolean>
|
||||||
<s:String x:Key="/Default/CodeEditing/GenerateMemberBody/DocumentationGenerationKind/@EntryValue">Inherit</s:String>
|
<s:String x:Key="/Default/CodeEditing/GenerateMemberBody/DocumentationGenerationKind/@EntryValue">Inherit</s:String>
|
||||||
<s:Boolean
|
|
||||||
x:Key="/Default/CodeEditing/TypingAssist/SkipClosingBracesOnTabInStringLiterals/@EntryValue">True</s:Boolean>
|
<!-- CodeInspection-->
|
||||||
<s:Boolean
|
<s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Ett/@EntryIndexedValue">True</s:Boolean>
|
||||||
x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Ett/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:String
|
|
||||||
x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AssignmentInConditionalExpression/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=LocalizableElement/@EntryIndexedValue">HINT</s:String>
|
|
||||||
<s:String
|
|
||||||
x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedAutoPropertyAccessor_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
|
||||||
<s:String
|
|
||||||
x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedAutoPropertyAccessor_002ELocal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
|
||||||
<s:String
|
|
||||||
x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
|
||||||
<s:String
|
|
||||||
x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
|
||||||
<s:String
|
|
||||||
x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_RECORD_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue">ID</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IOS/@EntryIndexedValue">IOS</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IP/@EntryIndexedValue">IP</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String>
|
|
||||||
<s:String
|
|
||||||
x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=TypesAndNamespaces/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /></s:String>
|
|
||||||
<s:String x:Key="/Default/CustomTools/CustomToolsData/@EntryValue"></s:String>
|
|
||||||
<s:Boolean
|
|
||||||
x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean
|
|
||||||
x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean
|
|
||||||
x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean
|
|
||||||
x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/ReSpeller/ReSpellerEnabled/@EntryValue">True</s:Boolean>
|
|
||||||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
|
|
||||||
<s:Int64
|
|
||||||
x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
|
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue">OFF</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue">OFF</s:String>
|
||||||
<s:String
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AssignmentInConditionalExpression/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=TooWideLocalVariableScope/@EntryIndexedValue">HINT</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ClassNeverInstantiated_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=DuplicateResource/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantPatternParentheses/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestBaseTypeForParameter/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestBaseTypeForParameterInConstructor/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=TooWideLocalVariableScope/@EntryIndexedValue">HINT</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedAutoPropertyAccessor_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedAutoPropertyAccessor_002ELocal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
|
|
||||||
|
<!-- CodeStyle-->
|
||||||
|
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
|
||||||
|
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
|
||||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOR/@EntryValue">Required</s:String>
|
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOR/@EntryValue">Required</s:String>
|
||||||
<s:String
|
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOREACH/@EntryValue">Required</s:String>
|
||||||
x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOREACH/@EntryValue">Required</s:String>
|
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_IFELSE/@EntryValue">Required</s:String>
|
||||||
<s:String
|
|
||||||
x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_IFELSE/@EntryValue">Required</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_WHILE/@EntryValue">Required</s:String>
|
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_WHILE/@EntryValue">Required</s:String>
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Constants/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /></s:String>
|
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue"><Policy Inspect="True" Prefix="_" Suffix="" Style="AA_BB" /></s:String>
|
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||||
<s:String
|
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||||
x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue"><Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /></s:String>
|
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_RECORD_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=StaticReadonly/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=15b5b1f1_002D457c_002D4ca6_002Db278_002D5615aedc07d3/@EntryIndexedValue"><Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static readonly fields (private)"><ElementKinds><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /></Policy></s:String>
|
||||||
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=236f7aa5_002D7b06_002D43ca_002Dbf2a_002D9b31bfcff09a/@EntryIndexedValue"><Policy><Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"><ElementKinds><Kind Name="CONSTANT_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="_" Suffix="" Style="AA_BB" /></Policy></s:String>
|
||||||
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=669e5282_002Dfb4b_002D4e90_002D91e7_002D07d269d04b60/@EntryIndexedValue"><Policy><Descriptor Staticness="Any" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Constant fields (not private)"><ElementKinds><Kind Name="CONSTANT_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /></Policy></s:String>
|
||||||
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=a0b4bc4d_002Dd13b_002D4a37_002Db37e_002Dc9c6864e4302/@EntryIndexedValue"><Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Types and namespaces"><ElementKinds><Kind Name="NAMESPACE" /><Kind Name="CLASS" /><Kind Name="STRUCT" /><Kind Name="ENUM" /><Kind Name="DELEGATE" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /></Policy></s:String>
|
||||||
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=c873eafb_002Dd57f_002D481d_002D8c93_002D77f6863c2f88/@EntryIndexedValue"><Policy><Descriptor Staticness="Static" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Static readonly fields (not private)"><ElementKinds><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy></s:String>
|
||||||
|
|
||||||
<s:String x:Key="/Default/CodeStyle/CSharpFileLayoutPatterns/Pattern/@EntryValue"><?xml version="1.0" encoding="utf-16"?>
|
<s:String x:Key="/Default/CodeStyle/CSharpFileLayoutPatterns/Pattern/@EntryValue"><?xml version="1.0" encoding="utf-16"?>
|
||||||
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
|
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
|
||||||
<TypePattern>
|
<TypePattern>
|
||||||
@ -93,36 +73,22 @@
|
|||||||
</Entry>
|
</Entry>
|
||||||
</TypePattern>
|
</TypePattern>
|
||||||
</Patterns></s:String>
|
</Patterns></s:String>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Aigc/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Biji/@EntryIndexedValue">True</s:Boolean>
|
<!-- Environment-->
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Childs/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Depts/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=fenlei/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=FFFFFF/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002EMemberReordering_002EMigrations_002ECSharpFileLayoutPatternRemoveIsAttributeUpgrade/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Furion/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Haojia/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=hongbao/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=inte/@EntryIndexedValue">True</s:Boolean>
|
<!-- ReSpeller-->
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=logourl/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/ReSpeller/ReSpellerEnabled/@EntryValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Meituan/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=miaosha/@EntryIndexedValue">True</s:Boolean>
|
<!-- UserDictionary-->
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=nicktitle/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=FLG/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=qudao/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=FLGL/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Responsing/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=RGX/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Smzdm/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=RGXL/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Tabao/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=tablename/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Taobao/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Taoke/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Tese/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=timesort/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=weixin/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=XBOXONE/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=youhui/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=yugao/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=YYYYMMDD/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=YYYYMMDDHHMMSSFFFZZZZ/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=zhiyou/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=zhuanlan/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
|
|
||||||
</wpf:ResourceDictionary>
|
</wpf:ResourceDictionary>
|
1
assets/README.md
Normal file
1
assets/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
# 资源文件目录
|
@ -11,19 +11,19 @@
|
|||||||
<WarningsAsErrors>true</WarningsAsErrors>
|
<WarningsAsErrors>true</WarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
|
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.9.1-alpha">
|
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.13.61">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Roslynator.Analyzers" Version="4.7.0">
|
<PackageReference Include="Roslynator.Analyzers" Version="4.13.1">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.15.0.81779">
|
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.7.0.110445">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReferenceFiles
|
<PackageReferenceFiles
|
||||||
Condition="%(PackageReference.CopyToOutputDirectory) != ''"
|
Condition="%(PackageReference.CopyToOutputDirectory) != ''"
|
||||||
Include="$(NugetPackageRoot)\%(PackageReference.Identity)\%(PackageReference.Version)\%(PackageReference.CopyToOutputDirectory)"/>
|
Include="$(NugetPackageRoot)\%(PackageReference.Identity)\%(PackageReference.Version)\%(PackageReference.CopyToOutputDirectory)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Copy SourceFiles="@(PackageReferenceFiles)" DestinationFolder="$(OutDir)"/>
|
<Copy SourceFiles="@(PackageReferenceFiles)" DestinationFolder="$(OutDir)" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
1
docker/README.md
Normal file
1
docker/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
docker
|
@ -3,7 +3,7 @@
|
|||||||
"isRoot": true,
|
"isRoot": true,
|
||||||
"tools": {
|
"tools": {
|
||||||
"dotnet-t4": {
|
"dotnet-t4": {
|
||||||
"version": "2.3.1",
|
"version": "3.0.0",
|
||||||
"commands": [
|
"commands": [
|
||||||
"t4"
|
"t4"
|
||||||
]
|
]
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<clear/>
|
<add key="nuget.cdn.azure.cn" value="https://nuget.cdn.azure.cn/v3/index.json" />
|
||||||
<add key="nuget.cdn.azure.cn" value="https://nuget.cdn.azure.cn/v3/index.json"/>
|
|
||||||
</packageSources>
|
</packageSources>
|
||||||
</configuration>
|
</configuration>
|
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"version": "2.0.11",
|
"version": "2.3.5",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cz-git": "^1.7.1",
|
"cz-git": "^1.11.0",
|
||||||
"commitizen": "^4.3.0",
|
"commitizen": "^4.3.1",
|
||||||
"prettier": "^3.1.0",
|
"prettier": "^3.3.3",
|
||||||
"standard-version": "^9.5.0"
|
"standard-version": "^9.5.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
$branch = $( git branch --show-current )
|
$branch = $( git branch --show-current )
|
||||||
git add ../
|
git add ../
|
||||||
./code.clean.ps1
|
$skipFormat = Read-Host "输入 n 跳过代码整理"
|
||||||
|
if ($skipFormat -ne "n")
|
||||||
|
{
|
||||||
|
./code.clean.ps1
|
||||||
|
}
|
||||||
git add ../
|
git add ../
|
||||||
../node_modules/.bin/git-cz.ps1
|
../node_modules/.bin/git-cz.ps1
|
||||||
git pull
|
git pull
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
cd ..
|
cd ..
|
||||||
$types = @{
|
$types = @{
|
||||||
'1' = @('major', '主版本')
|
'1' = @('major', '主版本')
|
||||||
'2' = @('minor', '此版本')
|
'2' = @('minor', '次版本')
|
||||||
'3' = @('patch', '修订版本')
|
'3' = @('patch', '修订版本')
|
||||||
}
|
}
|
||||||
$prefix = ''
|
$prefix = ''
|
||||||
@ -10,19 +10,20 @@ while ($null -eq $types[$prefix])
|
|||||||
$prefix = Read-Host "请选择版本类型`n" $( & { param($i) $i | ForEach-Object { "$_ : $( $types[$_][0] )($( $types[$_][1] ))`n" } } $types.Keys | Sort-Object )
|
$prefix = Read-Host "请选择版本类型`n" $( & { param($i) $i | ForEach-Object { "$_ : $( $types[$_][0] )($( $types[$_][1] ))`n" } } $types.Keys | Sort-Object )
|
||||||
}
|
}
|
||||||
git checkout main
|
git checkout main
|
||||||
|
git pull
|
||||||
git branch -D release
|
git branch -D release
|
||||||
git checkout -b release
|
git checkout -b release
|
||||||
./node_modules/.bin/standard-version -r $types[$prefix][0]
|
./node_modules/.bin/standard-version -r $types[$prefix][0]
|
||||||
cd ./scripts
|
|
||||||
./code.clean.ps1
|
|
||||||
git commit --amend --no-edit -a
|
git commit --amend --no-edit -a
|
||||||
$tag = $(git describe --tags $(git rev-list --tags --max-count=1))
|
$tag = $( git describe --tags $( git rev-list --tags --max-count = 1 ) )
|
||||||
git tag -d $tag
|
git tag -d $tag
|
||||||
git tag $tag
|
git tag $tag
|
||||||
git push --tags origin release
|
git push --tags origin release
|
||||||
Start-Process -FilePath "https://github.com/nsnail/NSExt/compare/main...release"
|
Start-Process -FilePath "https://github.com/nsnail/NSExt/compare/main...release"
|
||||||
Write-Host "按『Enter』回到主分支,『Ctrl+C』退出"
|
Write-Host "按『Enter』回到tk分支,『Ctrl+C』退出"
|
||||||
Pause
|
Pause
|
||||||
git checkout main
|
git checkout main
|
||||||
git pull
|
git pull
|
||||||
git branch -D release
|
git branch -D release
|
||||||
|
git branch -D tk
|
||||||
|
git checkout -b tk
|
2
scripts/4.git.del.obsolete.tags.ps1
Normal file
2
scripts/4.git.del.obsolete.tags.ps1
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
git push origin :refs/tags/$(git tag -l "*-*")
|
||||||
|
git tag -d $(git tag -l "*-*")
|
15
scripts/find.unused.ln.csx
Normal file
15
scripts/find.unused.ln.csx
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
Console.WriteLine(string.Join(Environment.NewLine
|
||||||
|
, Regex
|
||||||
|
.Matches(File.ReadAllText(@"../assets/res/Ln.resx")
|
||||||
|
, "data name=\"(.*?)\"")
|
||||||
|
.Select(x => x.Groups[1].Value)
|
||||||
|
.Where(x => !Directory
|
||||||
|
.GetFiles(@"../src/backend/", "*.cs"
|
||||||
|
, new EnumerationOptions {
|
||||||
|
RecurseSubdirectories = true
|
||||||
|
})
|
||||||
|
.Select(File.ReadAllText)
|
||||||
|
.Any(y => y.Contains(x)))));
|
||||||
|
Console.ReadKey();
|
@ -1,6 +1,7 @@
|
|||||||
<#@ template language="C#" #>
|
<#@ template language="C#" #>
|
||||||
<#@ assembly name="System.Xml" #>
|
<#@ assembly name="System.Xml" #>
|
||||||
<#@ output encoding="utf-8" extension="Designer.cs" #>
|
<#@ output encoding="utf-8" extension="Designer.cs" #>
|
||||||
|
<#@ import namespace="System.Xml" #>
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
@ -27,8 +28,8 @@ namespace NSExt.Languages;
|
|||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// with the /str option, or rebuild your VS project.
|
||||||
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
[System.Diagnostics.DebuggerNonUserCode]
|
[DebuggerNonUserCode]
|
||||||
[System.Runtime.CompilerServices.CompilerGenerated]
|
[CompilerGenerated]
|
||||||
public sealed class Ln
|
public sealed class Ln
|
||||||
{
|
{
|
||||||
private static ResourceManager _resourceMan;
|
private static ResourceManager _resourceMan;
|
||||||
@ -61,9 +62,9 @@ public sealed class Ln
|
|||||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||||
public static CultureInfo Culture { get; set; }
|
public static CultureInfo Culture { get; set; }
|
||||||
<#
|
<#
|
||||||
var xml = new System.Xml.XmlDocument();
|
var xml = new XmlDocument();
|
||||||
xml.Load("../assets/res/Ln.resx");
|
xml.Load("../assets/res/Ln.resx");
|
||||||
foreach (System.Xml.XmlNode data in xml.SelectNodes("//root/data")!)
|
foreach (XmlNode data in xml.SelectNodes("//root/data")!)
|
||||||
{
|
{
|
||||||
#>
|
#>
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
<#@ template language="C#" #>
|
<#@ template language="C#" #>
|
||||||
<#@ output encoding="utf-8" extension="resx" #>
|
<#@ output encoding="utf-8" extension="resx" #>
|
||||||
|
<#@ import namespace="System.IO" #>
|
||||||
|
<#@ import namespace="System.Linq" #>
|
||||||
|
<#@ import namespace="System.Text.RegularExpressions" #>
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
|
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
|
||||||
@ -25,15 +28,12 @@
|
|||||||
</value>
|
</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<#
|
<#
|
||||||
var regex = new System.Text.RegularExpressions.Regex(@"^\d", System.Text.RegularExpressions.RegexOptions.Compiled);
|
var regex = new Regex(@"^\d", RegexOptions.Compiled);
|
||||||
foreach (var file in System.IO.Directory.GetFiles("../assets/res/", "*.ln"))
|
foreach (var line in Directory.GetFiles("../assets/res/", "*.ln").SelectMany(x => File.ReadLines(x)).Distinct())
|
||||||
{
|
|
||||||
foreach (var line in System.IO.File.ReadLines(file))
|
|
||||||
{
|
{
|
||||||
#>
|
#>
|
||||||
<data name="<#= regex.IsMatch(line) ? "_" : "" #><#= line #>" xml:space="preserve"><value><#= line #></value></data>
|
<data name="<#= regex.IsMatch(line) ? "_" : "" #><#= line #>" xml:space="preserve"><value><#= line #></value></data>
|
||||||
<#
|
<#
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#>
|
#>
|
||||||
</root>
|
</root>
|
@ -1,4 +1,4 @@
|
|||||||
#r "nuget: NSExt, 1.1.0"
|
#r "nuget: NSExt, 2.2.0"
|
||||||
using NSExt.Extensions;
|
using NSExt.Extensions;
|
||||||
|
|
||||||
Console.WriteLine("请输入原始名称(NSExt):");
|
Console.WriteLine("请输入原始名称(NSExt):");
|
||||||
|
42
scripts/switch.nuget.or.project.csx
Normal file
42
scripts/switch.nuget.or.project.csx
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
using System.Text.RegularExpressions;
|
||||||
|
string input = string.Empty;
|
||||||
|
while (!new[] { "1", "2" }.Contains(input))
|
||||||
|
{
|
||||||
|
Console.WriteLine("1.nuget 2.project");
|
||||||
|
input = Console.ReadLine();
|
||||||
|
}
|
||||||
|
var slnFile = Directory.GetFiles(@"../", "*.sln").First();
|
||||||
|
var csprojFiles = Directory.GetFiles(@"../src", "*.csproj", new EnumerationOptions { RecurseSubdirectories = true });
|
||||||
|
var slnContent = File.ReadAllText(slnFile);
|
||||||
|
|
||||||
|
if (input == "1")
|
||||||
|
{
|
||||||
|
slnContent = Regex.Replace(slnContent, "\\nProject\\((.*)#refs", "\n##Project($1#refs");
|
||||||
|
slnContent = Regex.Replace(slnContent, "\\nEndProject#refs", "\n##EndProject#refs");
|
||||||
|
foreach (Match m in Regex.Matches(slnContent, "\"(\\{[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\\})\"#refs"))
|
||||||
|
{
|
||||||
|
slnContent = slnContent.Replace($" {m.Groups[1].Value}.", $" ##{m.Groups[1].Value}.");
|
||||||
|
}
|
||||||
|
foreach (var csprojFile in csprojFiles)
|
||||||
|
{
|
||||||
|
var csprojContent = File.ReadAllText(csprojFile);
|
||||||
|
csprojContent = Regex.Replace(csprojContent," <ProjectReference(.*)Label=\"refs\"(.*)>", " <!--<ProjectReference$1Label=\"refs\"$2>-->");
|
||||||
|
csprojContent = Regex.Replace(csprojContent," <!--<PackageReference(.*)Label=\"refs\"(.*)>-->", " <PackageReference$1Label=\"refs\"$2>");
|
||||||
|
File.WriteAllText(csprojFile, csprojContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
slnContent = Regex.Replace(slnContent, "##", "");
|
||||||
|
foreach (var csprojFile in csprojFiles)
|
||||||
|
{
|
||||||
|
var csprojContent = File.ReadAllText(csprojFile);
|
||||||
|
csprojContent = Regex.Replace(csprojContent," <!--<ProjectReference(.*)Label=\"refs\"(.*)>-->", " <ProjectReference$1Label=\"refs\"$2>");
|
||||||
|
csprojContent = Regex.Replace(csprojContent," <PackageReference(.*)Label=\"refs\"(.*)>", " <!--<PackageReference$1Label=\"refs\"$2>-->");
|
||||||
|
File.WriteAllText(csprojFile, csprojContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Console.WriteLine(slnContent);
|
||||||
|
File.WriteAllText(slnFile, slnContent);
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"solution": "NSExt.sln",
|
|
||||||
"mappings": {
|
|
||||||
"NSExt": "../refs/ns-ext/src/NSExt/NSExt.csproj"
|
|
||||||
},
|
|
||||||
"restore": [
|
|
||||||
{
|
|
||||||
"name": "NSExt",
|
|
||||||
"packages": [
|
|
||||||
{
|
|
||||||
"packageName": "NSExt",
|
|
||||||
"version": "1.1.0"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
# https://github.com/RicoSuter/DNT#switch-to-projects
|
|
||||||
$targets = @{
|
|
||||||
'1' = 'switch-to-projects'
|
|
||||||
'2' = 'switch-to-packages'
|
|
||||||
}
|
|
||||||
$key = ''
|
|
||||||
while ($null -eq $targets[$key])
|
|
||||||
{
|
|
||||||
$key = 读取-Host '请选择:1(切换到项目引用) 2(切换到Nuget包引用)'
|
|
||||||
}
|
|
||||||
$files = Get-ChildItem Switcher.*.json
|
|
||||||
$file = 9999
|
|
||||||
while ($null -eq $files[[int]$file - 1])
|
|
||||||
{
|
|
||||||
$i = 0
|
|
||||||
Write-Host '请选择要切换的配置文件文件'
|
|
||||||
foreach ($file in $files)
|
|
||||||
{
|
|
||||||
$i++
|
|
||||||
Write-Host $i $file.Name
|
|
||||||
}
|
|
||||||
$file = 读取-Host
|
|
||||||
}
|
|
||||||
$file = [int]$file - 1
|
|
||||||
Copy-Item $files[$file] 'switcher.json' -Force
|
|
||||||
dotnet dnt $targets[$key] ../NSExt.sln
|
|
||||||
Remove-Item switcher.json
|
|
@ -8,12 +8,12 @@ content = Regex.Replace(
|
|||||||
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"meta\", \"meta\", \"{5198A03D-0CAC-4828-A807-34A693F73859}\"(?:.|\n)*?EndProject",
|
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"meta\", \"meta\", \"{5198A03D-0CAC-4828-A807-34A693F73859}\"(?:.|\n)*?EndProject",
|
||||||
$$"""
|
$$"""
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{5198A03D-0CAC-4828-A807-34A693F73859}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{5198A03D-0CAC-4828-A807-34A693F73859}"
|
||||||
{{'\t'}}ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
{{string.Join('\n',
|
{{string.Join('\n',
|
||||||
Directory.GetFiles(@"../", "*").Where(x => !x.EndsWith(".sln") && !x.EndsWith(".user"))
|
Directory.GetFiles(@"../", "*").Where(x => !x.EndsWith(".sln") && !x.EndsWith(".user"))
|
||||||
.Select(x=>$"\t\t{Path.GetFileName(x)} = {Path.GetFileName(x)}")
|
.Select(x=>$" {Path.GetFileName(x)} = {Path.GetFileName(x)}")
|
||||||
)}}
|
)}}
|
||||||
{{'\t'}}EndProject
|
EndProject
|
||||||
"""
|
"""
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -22,12 +22,12 @@ content = Regex.Replace(
|
|||||||
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"workflows\", \"workflows\", \"{3C6F049E-3EE8-4D66-9AFF-E8A369032487}\"(?:.|\n)*?EndProject",
|
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"workflows\", \"workflows\", \"{3C6F049E-3EE8-4D66-9AFF-E8A369032487}\"(?:.|\n)*?EndProject",
|
||||||
$$"""
|
$$"""
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3C6F049E-3EE8-4D66-9AFF-E8A369032487}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3C6F049E-3EE8-4D66-9AFF-E8A369032487}"
|
||||||
{{'\t'}}ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
{{string.Join('\n',
|
{{string.Join('\n',
|
||||||
Directory.GetFiles(@"../.github/workflows", "*")
|
Directory.GetFiles(@"../.github/workflows", "*")
|
||||||
.Select(x=>$"\t\t{Path.GetFileName(x)} = .github/workflows/{Path.GetFileName(x)}")
|
.Select(x=>$" {Path.GetFileName(x)} = .github/workflows/{Path.GetFileName(x)}")
|
||||||
)}}
|
)}}
|
||||||
{{'\t'}}EndProject
|
EndProject
|
||||||
"""
|
"""
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -36,12 +36,12 @@ content = Regex.Replace(
|
|||||||
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"scripts\", \"scripts\", \"{BB0B25C9-0901-4923-913F-00F9A6B352A5}\"(?:.|\n)*?EndProject",
|
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"scripts\", \"scripts\", \"{BB0B25C9-0901-4923-913F-00F9A6B352A5}\"(?:.|\n)*?EndProject",
|
||||||
$$"""
|
$$"""
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B25C9-0901-4923-913F-00F9A6B352A5}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B25C9-0901-4923-913F-00F9A6B352A5}"
|
||||||
{{'\t'}}ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
{{string.Join('\n',
|
{{string.Join('\n',
|
||||||
Directory.GetFiles(@"../scripts", "*")
|
Directory.GetFiles(@"../scripts", "*")
|
||||||
.Select(x=>$"\t\t{Path.GetFileName(x)} = scripts/{Path.GetFileName(x)}")
|
.Select(x=>$" {Path.GetFileName(x)} = scripts/{Path.GetFileName(x)}")
|
||||||
)}}
|
)}}
|
||||||
{{'\t'}}EndProject
|
EndProject
|
||||||
"""
|
"""
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -50,12 +50,12 @@ content = Regex.Replace(
|
|||||||
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"build\", \"build\", \"{8E4C93BA-9493-4892-80C4-5E174C504829}\"(?:.|\n)*?EndProject",
|
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"build\", \"build\", \"{8E4C93BA-9493-4892-80C4-5E174C504829}\"(?:.|\n)*?EndProject",
|
||||||
$$"""
|
$$"""
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8E4C93BA-9493-4892-80C4-5E174C504829}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8E4C93BA-9493-4892-80C4-5E174C504829}"
|
||||||
{{'\t'}}ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
{{string.Join('\n',
|
{{string.Join('\n',
|
||||||
Directory.GetFiles(@"../build", "*")
|
Directory.GetFiles(@"../build", "*")
|
||||||
.Select(x=>$"\t\t{Path.GetFileName(x)} = build/{Path.GetFileName(x)}")
|
.Select(x=>$" {Path.GetFileName(x)} = build/{Path.GetFileName(x)}")
|
||||||
)}}
|
)}}
|
||||||
{{'\t'}}EndProject
|
EndProject
|
||||||
"""
|
"""
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
global using System;
|
global using System;
|
||||||
global using System.ComponentModel;
|
global using System.ComponentModel;
|
||||||
|
global using System.Diagnostics;
|
||||||
global using System.Globalization;
|
global using System.Globalization;
|
||||||
global using System.Text;
|
global using System.Text;
|
||||||
global using System.Text.RegularExpressions;
|
global using System.Text.RegularExpressions;
|
||||||
|
19
src/backend/NSExt.Tests/AllTests.cs
Normal file
19
src/backend/NSExt.Tests/AllTests.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using NSExt.Extensions;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace NSExt;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所有测试用例
|
||||||
|
/// </summary>
|
||||||
|
public class AllTests
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// IsJsonString
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void IsJsonString()
|
||||||
|
{
|
||||||
|
Assert.True("{\"a\":\"b\"}".IsJsonString());
|
||||||
|
}
|
||||||
|
}
|
@ -1,11 +1,12 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit" Version="2.6.3"/>
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0-preview-25107-01"/>
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
|
<PackageReference Include="xunit" Version="2.9.3"/>
|
||||||
|
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="coverlet.collector" Version="6.0.0">
|
<PackageReference Include="coverlet.collector" Version="6.0.4">
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
@ -19,7 +19,7 @@ public sealed class ResourceDescriptionAttribute<T> : Attribute
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源名称
|
/// 资源名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ResourceName { get; set; }
|
public string ResourceName { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源对象
|
/// 资源对象
|
||||||
|
@ -27,7 +27,7 @@ public static class EnumExtensions
|
|||||||
var resDescAttr = typeOfField!.GetCustomAttribute<ResourceDescriptionAttribute<T>>(true);
|
var resDescAttr = typeOfField!.GetCustomAttribute<ResourceDescriptionAttribute<T>>(true);
|
||||||
return resDescAttr is null
|
return resDescAttr is null
|
||||||
? Enum.GetName(typeOfEnum, e)
|
? Enum.GetName(typeOfEnum, e)
|
||||||
: typeof(T).GetProperty(resDescAttr.ResourceName)?.GetValue(default) as string;
|
: typeof(T).GetProperty(resDescAttr.ResourceName)?.GetValue(null) as string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -5,6 +5,26 @@ namespace NSExt.Extensions;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class EnumerableExtensions
|
public static class EnumerableExtensions
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 异步累加器函数
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="InvalidOperationException">InvalidOperationException</exception>
|
||||||
|
public static async Task<TSource> AggregateAsync<TSource>( //
|
||||||
|
this IEnumerable<TSource> source, Func<TSource, TSource, Task<TSource>> func)
|
||||||
|
{
|
||||||
|
using var e = source.GetEnumerator();
|
||||||
|
if (!e.MoveNext()) {
|
||||||
|
throw new InvalidOperationException("Sequence contains no elements");
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = e.Current;
|
||||||
|
while (e.MoveNext()) {
|
||||||
|
result = await func(result, e.Current).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 将列表转成分隔符分隔的字符串
|
/// 将列表转成分隔符分隔的字符串
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -36,6 +36,8 @@ public static class IntExtensions
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static string ToIpV4(this int me)
|
public static string ToIpV4(this int me)
|
||||||
{
|
{
|
||||||
return string.Join(".", BitConverter.GetBytes(me).Reverse());
|
var bytes = BitConverter.GetBytes(me);
|
||||||
|
Array.Reverse(bytes);
|
||||||
|
return string.Join('.', bytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -26,7 +26,7 @@ public static class StreamExtensions
|
|||||||
public static bool IsTextStream(this Stream me)
|
public static bool IsTextStream(this Stream me)
|
||||||
{
|
{
|
||||||
#pragma warning disable IDE0300
|
#pragma warning disable IDE0300
|
||||||
return me.FirstByteIndex(new byte[] { 0x00, 0xff }) < 0;
|
return me.FirstByteIndex([0x00, 0xff]) < 0;
|
||||||
#pragma warning restore IDE0300
|
#pragma warning restore IDE0300
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,10 +1,10 @@
|
|||||||
// ReSharper disable UnusedMember.Global
|
using System.Numerics;
|
||||||
// ReSharper disable MemberCanBePrivate.Global
|
using System.Reflection;
|
||||||
|
|
||||||
#pragma warning disable CA1720
|
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
using Microsoft.CodeAnalysis.CSharp.Scripting;
|
||||||
|
using Microsoft.CodeAnalysis.Scripting;
|
||||||
using NSExt.Constant;
|
using NSExt.Constant;
|
||||||
|
|
||||||
namespace NSExt.Extensions;
|
namespace NSExt.Extensions;
|
||||||
@ -12,9 +12,11 @@ namespace NSExt.Extensions;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// StringExtensions
|
/// StringExtensions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
#pragma warning disable CodeLinesAnalyzer
|
public static partial class StringExtensions
|
||||||
public static class StringExtensions
|
|
||||||
{
|
{
|
||||||
|
private const string _CHARACTERS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||||
|
private static readonly Regex _regexIpV4 = RegexIpV4();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// aes加密
|
/// aes加密
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -49,6 +51,64 @@ public static class StringExtensions
|
|||||||
return decrypted.HexDe();
|
return decrypted.HexDe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 将指定的输入字符串进行Base62解码
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="ArgumentException">ArgumentException</exception>
|
||||||
|
public static string Base62Decode(this string me)
|
||||||
|
{
|
||||||
|
BigInteger result = 0;
|
||||||
|
|
||||||
|
foreach (var index in me.Select(c => _CHARACTERS.IndexOf(c)))
|
||||||
|
{
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid character in Base62 string.");
|
||||||
|
}
|
||||||
|
|
||||||
|
result = result * 62 + index;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert BigInteger back to byte array and then to string
|
||||||
|
var bytes = result.ToByteArray();
|
||||||
|
|
||||||
|
// Handle the sign bit
|
||||||
|
if (bytes[^1] == 0)
|
||||||
|
{
|
||||||
|
Array.Resize(ref bytes, bytes.Length - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Encoding.UTF8.GetString(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 将指定的输入字符串进行Base62编码
|
||||||
|
/// </summary>
|
||||||
|
public static string Base62Encode(this string me)
|
||||||
|
{
|
||||||
|
// Convert string to byte array
|
||||||
|
var bytes = Encoding.UTF8.GetBytes(me);
|
||||||
|
|
||||||
|
// Convert byte array to BigInteger for easier processing
|
||||||
|
var bigInteger = new BigInteger(bytes);
|
||||||
|
|
||||||
|
if (bigInteger == 0)
|
||||||
|
{
|
||||||
|
return _CHARACTERS[0].ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = new StringBuilder();
|
||||||
|
|
||||||
|
while (bigInteger > 0)
|
||||||
|
{
|
||||||
|
var remainder = (int)(bigInteger % 62);
|
||||||
|
bigInteger /= 62;
|
||||||
|
_ = result.Insert(0, _CHARACTERS[remainder]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// base64编码
|
/// base64编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -81,6 +141,22 @@ public static class StringExtensions
|
|||||||
return e.GetString(me.Base64De());
|
return e.GetString(me.Base64De());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 解码避免转义的Base64
|
||||||
|
/// </summary>
|
||||||
|
public static string Base64InUrlDecode(this string me)
|
||||||
|
{
|
||||||
|
return me.Replace("-", "+").Replace("_", "/");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 编码避免转义的Base64
|
||||||
|
/// </summary>
|
||||||
|
public static string Base64InUrlEncode(this string me)
|
||||||
|
{
|
||||||
|
return me.Replace("+", "-").Replace("/", "_");
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 将易于web传输的base64web字符串转换为原生base64
|
/// 将易于web传输的base64web字符串转换为原生base64
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -99,6 +175,14 @@ public static class StringExtensions
|
|||||||
return me.Replace("+", "-").Replace("/", "_").Replace("=", ".");
|
return me.Replace("+", "-").Replace("/", "_").Replace("=", ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 计算Crc32
|
||||||
|
/// </summary>
|
||||||
|
public static int Crc32(this string me)
|
||||||
|
{
|
||||||
|
return BitConverter.ToInt32(System.IO.Hashing.Crc32.Hash(Encoding.UTF8.GetBytes(me)));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 将字符串转换成日期对象
|
/// 将字符串转换成日期对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -129,9 +213,7 @@ public static class StringExtensions
|
|||||||
/// <returns>转换后的日期对象</returns>
|
/// <returns>转换后的日期对象</returns>
|
||||||
public static DateTime DateTimeExactTry(this string me, string format, DateTime def)
|
public static DateTime DateTimeExactTry(this string me, string format, DateTime def)
|
||||||
{
|
{
|
||||||
return !System.DateTime.TryParseExact(me, format, CultureInfo.CurrentCulture, DateTimeStyles.None, out var ret)
|
return !System.DateTime.TryParseExact(me, format, CultureInfo.CurrentCulture, DateTimeStyles.None, out var ret) ? def : ret;
|
||||||
? def
|
|
||||||
: ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -142,9 +224,7 @@ public static class StringExtensions
|
|||||||
/// <returns>转换后的日期对象</returns>
|
/// <returns>转换后的日期对象</returns>
|
||||||
public static DateTime DateTimeTry(this string me, DateTime def)
|
public static DateTime DateTimeTry(this string me, DateTime def)
|
||||||
{
|
{
|
||||||
return !System.DateTime.TryParse(me, CultureInfo.InvariantCulture, DateTimeStyles.None, out var ret)
|
return !System.DateTime.TryParse(me, CultureInfo.InvariantCulture, DateTimeStyles.None, out var ret) ? def : ret;
|
||||||
? def
|
|
||||||
: ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -196,6 +276,15 @@ public static class StringExtensions
|
|||||||
return !System.Enum.TryParse(typeof(T), name, out var ret) ? def : (T)ret;
|
return !System.Enum.TryParse(typeof(T), name, out var ret) ? def : (T)ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行C#代码
|
||||||
|
/// </summary>
|
||||||
|
public static Task<T> ExecuteCSharpCodeAsync<T>(this string me, Assembly[] assemblies, params string[] importNamespaces)
|
||||||
|
{
|
||||||
|
// 使用 Roslyn 编译并执行代码
|
||||||
|
return CSharpScript.EvaluateAsync<T>(me, ScriptOptions.Default.WithReferences(assemblies).WithImports(importNamespaces));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// string to float
|
/// string to float
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -255,13 +344,13 @@ public static class StringExtensions
|
|||||||
/// <returns>hash摘要的16进制文本形式(无连字符小写)</returns>
|
/// <returns>hash摘要的16进制文本形式(无连字符小写)</returns>
|
||||||
public static string HmacSha1(this string me, string secret, Encoding e)
|
public static string HmacSha1(this string me, string secret, Encoding e)
|
||||||
{
|
{
|
||||||
#pragma warning disable CA5350
|
|
||||||
using var hmacSha1 = new HMACSHA1(e.GetBytes(secret));
|
using var hmacSha1 = new HMACSHA1(e.GetBytes(secret));
|
||||||
#pragma warning restore CA5350
|
|
||||||
|
|
||||||
return BitConverter.ToString(hmacSha1.ComputeHash(e.GetBytes(me)))
|
#if NET9_0_OR_GREATER
|
||||||
.Replace("-", string.Empty)
|
return Convert.ToHexStringLower(hmacSha1.ComputeHash(e.GetBytes(me)));
|
||||||
.ToLower(CultureInfo.CurrentCulture);
|
#else
|
||||||
|
return BitConverter.ToString(hmacSha1.ComputeHash(e.GetBytes(me))).Replace("-", string.Empty).ToLower(CultureInfo.CurrentCulture);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -341,16 +430,19 @@ public static class StringExtensions
|
|||||||
// 一个合法的Base64,有着以下特征:
|
// 一个合法的Base64,有着以下特征:
|
||||||
// 字符串的长度为4的整数倍。
|
// 字符串的长度为4的整数倍。
|
||||||
// 字符串的符号取值只能在A -Z, a -z, 0 -9, +, /, =共计65个字符中,且 = 如果出现就必须在结尾出现。
|
// 字符串的符号取值只能在A -Z, a -z, 0 -9, +, /, =共计65个字符中,且 = 如果出现就必须在结尾出现。
|
||||||
if (!me.All(x => x.IsBase64Character())) {
|
if (!me.All(x => x.IsBase64Character()))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me.Length % 4 != 0) {
|
if (me.Length % 4 != 0)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var firstEqualSignPos = me.IndexOf('=');
|
var firstEqualSignPos = me.IndexOf('=');
|
||||||
if (firstEqualSignPos < 0) {
|
if (firstEqualSignPos < 0)
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,6 +450,37 @@ public static class StringExtensions
|
|||||||
return lastEqualSignPos == me.Length - 1 && me[firstEqualSignPos..lastEqualSignPos].All(x => x == '=');
|
return lastEqualSignPos == me.Length - 1 && me[firstEqualSignPos..lastEqualSignPos].All(x => x == '=');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否IPV4地址
|
||||||
|
/// </summary>
|
||||||
|
public static bool IsIpV4(this string me)
|
||||||
|
{
|
||||||
|
return _regexIpV4.IsMatch(me);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否json字符串
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="me">me</param>
|
||||||
|
public static bool IsJsonString(this string me)
|
||||||
|
{
|
||||||
|
if (me.NullOrEmpty())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_ = JsonDocument.Parse(me);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 中文姓名打马赛克
|
/// 中文姓名打马赛克
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -384,11 +507,13 @@ public static class StringExtensions
|
|||||||
/// <returns>hash摘要的16进制文本形式(无连字符小写)</returns>
|
/// <returns>hash摘要的16进制文本形式(无连字符小写)</returns>
|
||||||
public static string Md5(this string me, Encoding e)
|
public static string Md5(this string me, Encoding e)
|
||||||
{
|
{
|
||||||
#pragma warning disable CA5351
|
#if NET9_0_OR_GREATER
|
||||||
|
return Convert.ToHexStringLower(MD5.HashData(e.GetBytes(me)));
|
||||||
|
#else
|
||||||
return BitConverter.ToString(MD5.HashData(e.GetBytes(me)))
|
return BitConverter.ToString(MD5.HashData(e.GetBytes(me)))
|
||||||
#pragma warning restore CA5351
|
|
||||||
.Replace("-", string.Empty)
|
.Replace("-", string.Empty)
|
||||||
.ToLower(CultureInfo.CurrentCulture);
|
.ToLower(CultureInfo.CurrentCulture);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -469,11 +594,13 @@ public static class StringExtensions
|
|||||||
/// <returns>hash摘要的16进制文本形式(无连字符小写)</returns>
|
/// <returns>hash摘要的16进制文本形式(无连字符小写)</returns>
|
||||||
public static string Sha1(this string me, Encoding e)
|
public static string Sha1(this string me, Encoding e)
|
||||||
{
|
{
|
||||||
#pragma warning disable CA5350
|
#if NET9_0_OR_GREATER
|
||||||
|
return Convert.ToHexStringLower(SHA1.HashData(e.GetBytes(me)));
|
||||||
|
#else
|
||||||
return BitConverter.ToString(SHA1.HashData(e.GetBytes(me)))
|
return BitConverter.ToString(SHA1.HashData(e.GetBytes(me)))
|
||||||
#pragma warning restore CA5350
|
|
||||||
.Replace("-", string.Empty)
|
.Replace("-", string.Empty)
|
||||||
.ToLower(CultureInfo.CurrentCulture);
|
.ToLower(CultureInfo.CurrentCulture);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -489,7 +616,8 @@ public static class StringExtensions
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static string Sub(this string me, int startIndex, int length)
|
public static string Sub(this string me, int startIndex, int length)
|
||||||
{
|
{
|
||||||
if (startIndex + length > me.Length) {
|
if (startIndex + length > me.Length)
|
||||||
|
{
|
||||||
length = me.Length - startIndex;
|
length = me.Length - startIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -509,10 +637,7 @@ public static class StringExtensions
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static string ToLowerCamelCase(this string me)
|
public static string ToLowerCamelCase(this string me)
|
||||||
{
|
{
|
||||||
return string.IsNullOrWhiteSpace(me)
|
return string.IsNullOrWhiteSpace(me) ? me : string.Concat(me[0].ToString(CultureInfo.InvariantCulture).ToLowerInvariant(), me.AsSpan(1));
|
||||||
? me
|
|
||||||
: string.Concat( //
|
|
||||||
me[0].ToString(CultureInfo.InvariantCulture).ToLowerInvariant(), me.AsSpan(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -523,6 +648,14 @@ public static class StringExtensions
|
|||||||
return string.IsNullOrWhiteSpace(me) ? me : string.Concat(me[0].ToString().ToUpperInvariant(), me.AsSpan(1));
|
return string.IsNullOrWhiteSpace(me) ? me : string.Concat(me[0].ToString().ToUpperInvariant(), me.AsSpan(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 去掉前部字符串
|
||||||
|
/// </summary>
|
||||||
|
public static string TrimPrefix(this string me, string clearStr)
|
||||||
|
{
|
||||||
|
return Regex.Replace(me, $"^{clearStr}", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 将连续多个空格替换成一个空格
|
/// 将连续多个空格替换成一个空格
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -534,24 +667,25 @@ public static class StringExtensions
|
|||||||
return ret == me ? ret : ret.TrimSpaces();
|
return ret == me ? ret : ret.TrimSpaces();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 去掉尾部字符串
|
||||||
|
/// </summary>
|
||||||
|
public static string TrimSuffix(this string me, string clearStr)
|
||||||
|
{
|
||||||
|
return Regex.Replace(me, $"{clearStr}$", string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 将\ux0000 、 %u0000 、 &#x0000; 编码转换成可读字符串
|
/// 将\ux0000 、 %u0000 、 &#x0000; 编码转换成可读字符串
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string UnicodeDe(this string me)
|
public static string UnicodeDe(this string me)
|
||||||
{
|
{
|
||||||
|
#pragma warning disable S3358, RCS1238
|
||||||
const string replacement = "&#x$1;";
|
const string replacement = "&#x$1;";
|
||||||
if (me.Contains(@"\u")) {
|
return !me.Contains(@"\u")
|
||||||
return Regexes.RegexBacksLantUnicode.Replace(me, replacement).HtmlDe();
|
? me.Contains("%u") ? Regexes.RegexPercentUnicode.Replace(me, replacement).HtmlDe() : me.HtmlDe()
|
||||||
}
|
: Regexes.RegexBacksLantUnicode.Replace(me, replacement).HtmlDe();
|
||||||
|
#pragma warning restore S3358, RCS1238
|
||||||
// ReSharper disable once ConvertIfStatementToReturnStatement
|
|
||||||
#pragma warning disable IDE0046
|
|
||||||
if (me.Contains("%u")) {
|
|
||||||
#pragma warning restore IDE0046
|
|
||||||
return Regexes.RegexPercentUnicode.Replace(me, replacement).HtmlDe();
|
|
||||||
}
|
|
||||||
|
|
||||||
return me.HtmlDe();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -583,12 +717,15 @@ public static class StringExtensions
|
|||||||
/// <returns>hash摘要的16进制文本形式(无连字符小写)</returns>
|
/// <returns>hash摘要的16进制文本形式(无连字符小写)</returns>
|
||||||
private static string Md5Hmac(this string me, string key, Encoding e)
|
private static string Md5Hmac(this string me, string key, Encoding e)
|
||||||
{
|
{
|
||||||
#pragma warning disable CA5351
|
|
||||||
using var md5Hmac = new HMACMD5(e.GetBytes(key));
|
using var md5Hmac = new HMACMD5(e.GetBytes(key));
|
||||||
#pragma warning restore CA5351
|
|
||||||
return BitConverter.ToString(md5Hmac.ComputeHash(e.GetBytes(me)))
|
#if NET9_0_OR_GREATER
|
||||||
.Replace("-", string.Empty)
|
return Convert.ToHexStringLower(md5Hmac.ComputeHash(e.GetBytes(me)));
|
||||||
.ToLower(CultureInfo.CurrentCulture);
|
#else
|
||||||
|
return BitConverter.ToString(md5Hmac.ComputeHash(e.GetBytes(me))).Replace("-", string.Empty).ToLower(CultureInfo.CurrentCulture);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[GeneratedRegex(@"^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})){3}$")]
|
||||||
|
private static partial Regex RegexIpV4();
|
||||||
}
|
}
|
||||||
#pragma warning restore CodeLinesAnalyzer
|
|
@ -7,7 +7,9 @@
|
|||||||
<Import Project="$(SolutionDir)/build/copy.pkg.xml.comment.files.targets"/>
|
<Import Project="$(SolutionDir)/build/copy.pkg.xml.comment.files.targets"/>
|
||||||
<Import Project="$(SolutionDir)/build/prebuild.targets"/>
|
<Import Project="$(SolutionDir)/build/prebuild.targets"/>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0"/>
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.13.0"/>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.3"/>
|
||||||
|
<PackageReference Include="System.IO.Hashing" Version="9.0.3"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Update="*.json">
|
<None Update="*.json">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user