mirror of
https://github.com/nsnail/dot.git
synced 2025-06-17 13:03:22 +08:00
<chore>
This commit is contained in:
parent
7d1763246f
commit
ab0af253a4
@ -13,14 +13,20 @@ trim_trailing_whitespace = true
|
||||
[*.cs]
|
||||
dotnet_analyzer_diagnostic.severity = warning
|
||||
dotnet_diagnostic.CA1707.severity = none
|
||||
dotnet_diagnostic.CA1716.severity = none
|
||||
dotnet_diagnostic.CA1848.severity = none
|
||||
dotnet_diagnostic.CA2254.severity = none
|
||||
dotnet_diagnostic.CA5350.severity = none
|
||||
dotnet_diagnostic.CA5351.severity = none
|
||||
dotnet_diagnostic.IDE0005.severity = none
|
||||
dotnet_diagnostic.IDE0008.severity = none
|
||||
dotnet_diagnostic.IDE0010.severity = none
|
||||
dotnet_diagnostic.IDE0017.severity = none
|
||||
dotnet_diagnostic.IDE0048.severity = none
|
||||
dotnet_diagnostic.IDE0055.severity = none
|
||||
dotnet_diagnostic.IDE0058.severity = none
|
||||
dotnet_diagnostic.IDE0160.severity = none
|
||||
dotnet_diagnostic.SYSLIB1045.severity = none
|
||||
|
||||
|
||||
# ReSharper properties
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -29,7 +29,7 @@ x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
# [Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
@ -399,6 +399,6 @@ FodyWeavers.xsd
|
||||
.idea/
|
||||
|
||||
# User Define
|
||||
build/
|
||||
dist/
|
||||
nuget.config
|
||||
*.[Dd]esigner.cs
|
@ -1,16 +1,27 @@
|
||||
#r "nuget: Newtonsoft.Json, 13.0.0"
|
||||
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
var path = Directory.GetFiles(@".idea", "workspace.xml", SearchOption.AllDirectories).First();
|
||||
const string findStr = """
|
||||
"keyToString": {
|
||||
""";
|
||||
const string replaceStr = """
|
||||
"keyToString": {
|
||||
"rider.code.cleanup.on.save": "true",
|
||||
""";
|
||||
var content = File.ReadAllText(path);
|
||||
if(content.Contains("rider.code.cleanup.on.save")){
|
||||
Console.WriteLine("alreay added");
|
||||
return;
|
||||
XmlDocument xdoc = new XmlDocument();
|
||||
using(var fs = File.Open(path, FileMode.Open)){
|
||||
xdoc.Load(fs);
|
||||
fs.Seek(0, SeekOrigin.Begin);
|
||||
var propertiesComponent = xdoc.SelectSingleNode("""//component[@name="PropertiesComponent"]""");
|
||||
var jsonStr = propertiesComponent.InnerText;
|
||||
var jsonObj = JObject.Parse(jsonStr);
|
||||
var keyToStringObj = jsonObj["keyToString"] as JObject;
|
||||
if (keyToStringObj.ContainsKey("rider.code.cleanup.on.save")) return;
|
||||
|
||||
keyToStringObj.Add(new JProperty("rider.code.cleanup.on.save", "true"));
|
||||
var newNode = xdoc.CreateCDataSection(jsonObj.ToString());
|
||||
propertiesComponent.InnerText=string.Empty;
|
||||
propertiesComponent.AppendChild(newNode);
|
||||
var settings = new XmlWriterSettings { Indent = true };
|
||||
using(var writer = XmlWriter.Create(fs, settings)){
|
||||
xdoc.WriteTo(writer);
|
||||
}
|
||||
content = content.Replace(findStr, replaceStr);
|
||||
Console.WriteLine(content);
|
||||
File.WriteAllText(path, content);
|
||||
|
||||
}
|
@ -13,5 +13,9 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<!-- <PackageReference Include="NSCodeAnalysis" Version="1.0.1-alpha.0.2">-->
|
||||
<!-- <PrivateAssets>all</PrivateAssets>-->
|
||||
<!-- <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>-->
|
||||
<!-- </PackageReference>-->
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,10 +1,26 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<BaseOutputPath>../dist</BaseOutputPath>
|
||||
<Authors>nsnail</Authors>
|
||||
<BaseIntermediateOutputPath>../dist</BaseIntermediateOutputPath>
|
||||
<OutputPath>$(BaseOutputPath)/$(MSBuildProjectName)/bin</OutputPath>
|
||||
<BaseOutputPath>../dist</BaseOutputPath>
|
||||
<Copyright>© 2006-2023 nsnail</Copyright>
|
||||
<Description>功能全面的实用工具 - 程序员的瑞士军刀</Description>
|
||||
<EnableBaseIntermediateOutputPathMismatchWarning>false</EnableBaseIntermediateOutputPathMismatchWarning>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<IntermediateOutputPath>$(BaseIntermediateOutputPath)/$(MSBuildProjectName)/obj</IntermediateOutputPath>
|
||||
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)/$(MSBuildProjectName)/obj</MSBuildProjectExtensionsPath>
|
||||
<OutputPath>$(BaseOutputPath)/$(MSBuildProjectName)/bin</OutputPath>
|
||||
<Product>dot</Product>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/nsnail/dot.git</RepositoryUrl>
|
||||
<RootNamespace>Dot</RootNamespace>
|
||||
<Title>$(AssemblyName)</Title>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MinVer" Version="4.3.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,9 +1,9 @@
|
||||
<Project>
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<ItemGroup Condition="!Exists('$(ProjectDir)\Lang\Str.Designer.cs')">
|
||||
<Compile Include="$(ProjectDir)\Lang\Str.Designer.cs"/>
|
||||
<ItemGroup Condition="!Exists('$(ProjectDir)\Languages\Ln.Designer.cs')">
|
||||
<Compile Include="$(ProjectDir)\Languages\Ln.Designer.cs" />
|
||||
</ItemGroup>
|
||||
<Exec Command="dotnet tool restore" StdOutEncoding="utf-8"/>
|
||||
<Exec WorkingDirectory="$(ProjectDir)\Lang" Command="dotnet t4 Str.tt" StdOutEncoding="utf-8"/>
|
||||
<Exec Command="dotnet tool restore" StdOutEncoding="utf-8" />
|
||||
<Exec WorkingDirectory="$(ProjectDir)\Languages" Command="dotnet t4 Ln.tt" StdOutEncoding="utf-8" />
|
||||
</Target>
|
||||
</Project>
|
@ -3,219 +3,211 @@
|
||||
Description="StyleCop.Analyzers with default action. Rules with IsEnabledByDefault = false are disabled."
|
||||
ToolsVersion="14.0">
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.SpecialRules">
|
||||
<Rule Id="SA0001" Action="Warning"/> <!-- XML comment analysis disabled -->
|
||||
<Rule Id="SA0002" Action="Warning"/> <!-- Invalid settings file -->
|
||||
<Rule Id="SA0001" Action="Warning" /> <!-- XML comment analysis disabled -->
|
||||
<Rule Id="SA0002" Action="Warning" /> <!-- Invalid settings file -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.SpacingRules">
|
||||
<Rule Id="SA1000" Action="Warning"/> <!-- Keywords should be spaced correctly -->
|
||||
<Rule Id="SA1001" Action="None"/> <!-- Commas should be spaced correctly -->
|
||||
<Rule Id="SA1002" Action="Warning"/> <!-- Semicolons should be spaced correctly -->
|
||||
<Rule Id="SA1003" Action="Warning"/> <!-- Symbols should be spaced correctly -->
|
||||
<Rule Id="SA1004" Action="Warning"/> <!-- Documentation lines should begin with single space -->
|
||||
<Rule Id="SA1005" Action="None"/> <!-- Single line comments should begin with single space -->
|
||||
<Rule Id="SA1006" Action="Warning"/> <!-- Preprocessor keywords should not be preceded by space -->
|
||||
<Rule Id="SA1007" Action="Warning"/> <!-- Operator keyword should be followed by space -->
|
||||
<Rule Id="SA1008" Action="None"/> <!-- Opening parenthesis should be spaced correctly -->
|
||||
<Rule Id="SA1009" Action="Warning"/> <!-- Closing parenthesis should be spaced correctly -->
|
||||
<Rule Id="SA1010" Action="Warning"/> <!-- Opening square brackets should be spaced correctly -->
|
||||
<Rule Id="SA1011" Action="Warning"/> <!-- Closing square brackets should be spaced correctly -->
|
||||
<Rule Id="SA1012" Action="Warning"/> <!-- Opening braces should be spaced correctly -->
|
||||
<Rule Id="SA1013" Action="Warning"/> <!-- Closing braces should be spaced correctly -->
|
||||
<Rule Id="SA1014" Action="Warning"/> <!-- Opening generic brackets should be spaced correctly -->
|
||||
<Rule Id="SA1015" Action="Warning"/> <!-- Closing generic brackets should be spaced correctly -->
|
||||
<Rule Id="SA1016" Action="Warning"/> <!-- Opening attribute brackets should be spaced correctly -->
|
||||
<Rule Id="SA1017" Action="Warning"/> <!-- Closing attribute brackets should be spaced correctly -->
|
||||
<Rule Id="SA1018" Action="Warning"/> <!-- Nullable type symbols should be spaced correctly -->
|
||||
<Rule Id="SA1019" Action="Warning"/> <!-- Member access symbols should be spaced correctly -->
|
||||
<Rule Id="SA1020" Action="Warning"/> <!-- Increment decrement symbols should be spaced correctly -->
|
||||
<Rule Id="SA1021" Action="Warning"/> <!-- Negative signs should be spaced correctly -->
|
||||
<Rule Id="SA1022" Action="Warning"/> <!-- Positive signs should be spaced correctly -->
|
||||
<Rule Id="SA1023" Action="Warning"/> <!-- Dereference and access of symbols should be spaced correctly -->
|
||||
<Rule Id="SA1024" Action="Warning"/> <!-- Colons should be spaced correctly -->
|
||||
<Rule Id="SA1025" Action="None"/> <!-- Code should not contain multiple whitespace in a row -->
|
||||
<Rule Id="SA1026" Action="Warning"/> <!-- Code should not contain space after new or stackalloc keyword in implicitly typed array allocation -->
|
||||
<Rule Id="SA1027" Action="Warning"/> <!-- Use tabs correctly -->
|
||||
<Rule Id="SA1028" Action="Warning"/> <!-- Code should not contain trailing whitespace -->
|
||||
<Rule Id="SA1000" Action="Warning" /> <!-- Keywords should be spaced correctly -->
|
||||
<Rule Id="SA1001" Action="None" /> <!-- Commas should be spaced correctly -->
|
||||
<Rule Id="SA1002" Action="Warning" /> <!-- Semicolons should be spaced correctly -->
|
||||
<Rule Id="SA1003" Action="Warning" /> <!-- Symbols should be spaced correctly -->
|
||||
<Rule Id="SA1004" Action="Warning" /> <!-- Documentation lines should begin with single space -->
|
||||
<Rule Id="SA1005" Action="Warning" /> <!-- Single line comments should begin with single space -->
|
||||
<Rule Id="SA1006" Action="Warning" /> <!-- Preprocessor keywords should not be preceded by space -->
|
||||
<Rule Id="SA1007" Action="Warning" /> <!-- Operator keyword should be followed by space -->
|
||||
<Rule Id="SA1008" Action="None" /> <!-- Opening parenthesis should be spaced correctly -->
|
||||
<Rule Id="SA1009" Action="Warning" /> <!-- Closing parenthesis should be spaced correctly -->
|
||||
<Rule Id="SA1010" Action="Warning" /> <!-- Opening square brackets should be spaced correctly -->
|
||||
<Rule Id="SA1011" Action="Warning" /> <!-- Closing square brackets should be spaced correctly -->
|
||||
<Rule Id="SA1012" Action="Warning" /> <!-- Opening braces should be spaced correctly -->
|
||||
<Rule Id="SA1013" Action="Warning" /> <!-- Closing braces should be spaced correctly -->
|
||||
<Rule Id="SA1014" Action="Warning" /> <!-- Opening generic brackets should be spaced correctly -->
|
||||
<Rule Id="SA1015" Action="Warning" /> <!-- Closing generic brackets should be spaced correctly -->
|
||||
<Rule Id="SA1016" Action="Warning" /> <!-- Opening attribute brackets should be spaced correctly -->
|
||||
<Rule Id="SA1017" Action="Warning" /> <!-- Closing attribute brackets should be spaced correctly -->
|
||||
<Rule Id="SA1018" Action="Warning" /> <!-- Nullable type symbols should be spaced correctly -->
|
||||
<Rule Id="SA1019" Action="Warning" /> <!-- Member access symbols should be spaced correctly -->
|
||||
<Rule Id="SA1020" Action="Warning" /> <!-- Increment decrement symbols should be spaced correctly -->
|
||||
<Rule Id="SA1021" Action="Warning" /> <!-- Negative signs should be spaced correctly -->
|
||||
<Rule Id="SA1022" Action="Warning" /> <!-- Positive signs should be spaced correctly -->
|
||||
<Rule Id="SA1023" Action="Warning" /> <!-- Dereference and access of symbols should be spaced correctly -->
|
||||
<Rule Id="SA1024" Action="Warning" /> <!-- Colons should be spaced correctly -->
|
||||
<Rule Id="SA1025" Action="None" /> <!-- Code should not contain multiple whitespace in a row -->
|
||||
<Rule Id="SA1026" Action="Warning" /> <!-- Code should not contain space after new or stackalloc keyword in implicitly typed array allocation -->
|
||||
<Rule Id="SA1027" Action="Warning" /> <!-- Use tabs correctly -->
|
||||
<Rule Id="SA1028" Action="Warning" /> <!-- Code should not contain trailing whitespace -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.ReadabilityRules">
|
||||
<Rule Id="SA1100" Action="Warning"/> <!-- Do not prefix calls with base unless local implementation exists -->
|
||||
<Rule Id="SA1101" Action="None"/> <!-- Prefix local calls with this -->
|
||||
<Rule Id="SA1102" Action="Warning"/> <!-- Query clause should follow previous clause -->
|
||||
<Rule Id="SA1103" Action="Warning"/> <!-- Query clauses should be on separate lines or all on one line -->
|
||||
<Rule Id="SA1104" Action="Warning"/> <!-- Query clause should begin on new line when previous clause spans multiple lines -->
|
||||
<Rule Id="SA1105" Action="Warning"/> <!-- Query clauses spanning multiple lines should begin on own line -->
|
||||
<Rule Id="SA1106" Action="Warning"/> <!-- Code should not contain empty statements -->
|
||||
<Rule Id="SA1107" Action="Warning"/> <!-- Code should not contain multiple statements on one line -->
|
||||
<Rule Id="SA1108" Action="Warning"/> <!-- Block statements should not contain embedded comments -->
|
||||
<Rule Id="SA1109" Action="Warning"/> <!-- Block statements should not contain embedded regions -->
|
||||
<Rule Id="SA1110" Action="Warning"/> <!-- Opening parenthesis or bracket should be on declaration line -->
|
||||
<Rule Id="SA1111" Action="Warning"/> <!-- Closing parenthesis should be on line of last parameter -->
|
||||
<Rule Id="SA1112" Action="Warning"/> <!-- Closing parenthesis should be on line of opening parenthesis -->
|
||||
<Rule Id="SA1113" Action="None"/> <!-- Comma should be on the same line as previous parameter -->
|
||||
<Rule Id="SA1114" Action="Warning"/> <!-- Parameter list should follow declaration -->
|
||||
<Rule Id="SA1115" Action="Warning"/> <!-- Parameter should follow comma -->
|
||||
<Rule Id="SA1116" Action="Warning"/> <!-- Split parameters should start on line after declaration -->
|
||||
<Rule Id="SA1117" Action="None"/> <!-- Parameters should be on same line or separate lines -->
|
||||
<Rule Id="SA1118" Action="Warning"/> <!-- Parameter should not span multiple lines -->
|
||||
<Rule Id="SA1120" Action="None"/> <!-- Comments should contain text -->
|
||||
<Rule Id="SA1121" Action="Warning"/> <!-- Use built-in type alias -->
|
||||
<Rule Id="SA1122" Action="Warning"/> <!-- Use string.Empty for empty strings -->
|
||||
<Rule Id="SA1123" Action="Warning"/> <!-- Do not place regions within elements -->
|
||||
<Rule Id="SA1124" Action="Warning"/> <!-- Do not use regions -->
|
||||
<Rule Id="SA1125" Action="Warning"/> <!-- Use shorthand for nullable types -->
|
||||
<Rule Id="SA1126" Action="Warning"/> <!-- Prefix calls correctly -->
|
||||
<Rule Id="SA1127" Action="Warning"/> <!-- Generic type constraints should be on their own line -->
|
||||
<Rule Id="SA1128" Action="Warning"/> <!-- Put constructor initializers on their own line -->
|
||||
<Rule Id="SA1129" Action="Warning"/> <!-- Do not use default value type constructor -->
|
||||
<Rule Id="SA1130" Action="Warning"/> <!-- Use lambda syntax -->
|
||||
<Rule Id="SA1131" Action="Warning"/> <!-- Use readable conditions -->
|
||||
<Rule Id="SA1132" Action="Warning"/> <!-- Do not combine fields -->
|
||||
<Rule Id="SA1133" Action="Warning"/> <!-- Do not combine attributes -->
|
||||
<Rule Id="SA1134" Action="None"/> <!-- Attributes should not share line -->
|
||||
<Rule Id="SA1135" Action="Warning"/> <!-- Using directives should be qualified -->
|
||||
<Rule Id="SA1136" Action="Warning"/> <!-- Enum values should be on separate lines -->
|
||||
<Rule Id="SA1137" Action="Warning"/> <!-- Elements should have the same indentation -->
|
||||
<Rule Id="SA1139" Action="Warning"/> <!-- Use literal suffix notation instead of casting -->
|
||||
<Rule Id="SX1101" Action="Warning"/> <!-- Do not prefix local calls with 'this.' -->
|
||||
<Rule Id="SA1100" Action="Warning" /> <!-- Do not prefix calls with base unless local implementation exists -->
|
||||
<Rule Id="SA1101" Action="None" /> <!-- Prefix local calls with this -->
|
||||
<Rule Id="SA1102" Action="Warning" /> <!-- Query clause should follow previous clause -->
|
||||
<Rule Id="SA1103" Action="Warning" /> <!-- Query clauses should be on separate lines or all on one line -->
|
||||
<Rule Id="SA1104" Action="Warning" /> <!-- Query clause should begin on new line when previous clause spans multiple lines -->
|
||||
<Rule Id="SA1105" Action="Warning" /> <!-- Query clauses spanning multiple lines should begin on own line -->
|
||||
<Rule Id="SA1106" Action="Warning" /> <!-- Code should not contain empty statements -->
|
||||
<Rule Id="SA1107" Action="Warning" /> <!-- Code should not contain multiple statements on one line -->
|
||||
<Rule Id="SA1108" Action="Warning" /> <!-- Block statements should not contain embedded comments -->
|
||||
<Rule Id="SA1109" Action="Warning" /> <!-- Block statements should not contain embedded regions -->
|
||||
<Rule Id="SA1110" Action="Warning" /> <!-- Opening parenthesis or bracket should be on declaration line -->
|
||||
<Rule Id="SA1111" Action="Warning" /> <!-- Closing parenthesis should be on line of last parameter -->
|
||||
<Rule Id="SA1112" Action="Warning" /> <!-- Closing parenthesis should be on line of opening parenthesis -->
|
||||
<Rule Id="SA1113" Action="None" /> <!-- Comma should be on the same line as previous parameter -->
|
||||
<Rule Id="SA1114" Action="Warning" /> <!-- Parameter list should follow declaration -->
|
||||
<Rule Id="SA1115" Action="Warning" /> <!-- Parameter should follow comma -->
|
||||
<Rule Id="SA1116" Action="Warning" /> <!-- Split parameters should start on line after declaration -->
|
||||
<Rule Id="SA1117" Action="None" /> <!-- Parameters should be on same line or separate lines -->
|
||||
<Rule Id="SA1118" Action="Warning" /> <!-- Parameter should not span multiple lines -->
|
||||
<Rule Id="SA1120" Action="None" /> <!-- Comments should contain text -->
|
||||
<Rule Id="SA1121" Action="Warning" /> <!-- Use built-in type alias -->
|
||||
<Rule Id="SA1122" Action="Warning" /> <!-- Use string.Empty for empty strings -->
|
||||
<Rule Id="SA1123" Action="Warning" /> <!-- Do not place regions within elements -->
|
||||
<Rule Id="SA1124" Action="Warning" /> <!-- Do not use regions -->
|
||||
<Rule Id="SA1125" Action="Warning" /> <!-- Use shorthand for nullable types -->
|
||||
<Rule Id="SA1126" Action="Warning" /> <!-- Prefix calls correctly -->
|
||||
<Rule Id="SA1127" Action="Warning" /> <!-- Generic type constraints should be on their own line -->
|
||||
<Rule Id="SA1128" Action="Warning" /> <!-- Put constructor initializers on their own line -->
|
||||
<Rule Id="SA1129" Action="Warning" /> <!-- Do not use default value type constructor -->
|
||||
<Rule Id="SA1130" Action="Warning" /> <!-- Use lambda syntax -->
|
||||
<Rule Id="SA1131" Action="Warning" /> <!-- Use readable conditions -->
|
||||
<Rule Id="SA1132" Action="Warning" /> <!-- Do not combine fields -->
|
||||
<Rule Id="SA1133" Action="Warning" /> <!-- Do not combine attributes -->
|
||||
<Rule Id="SA1134" Action="Warning" /> <!-- Attributes should not share line -->
|
||||
<Rule Id="SA1135" Action="Warning" /> <!-- Using directives should be qualified -->
|
||||
<Rule Id="SA1136" Action="Warning" /> <!-- Enum values should be on separate lines -->
|
||||
<Rule Id="SA1137" Action="Warning" /> <!-- Elements should have the same indentation -->
|
||||
<Rule Id="SA1139" Action="Warning" /> <!-- Use literal suffix notation instead of casting -->
|
||||
<Rule Id="SX1101" Action="Warning" /> <!-- Do not prefix local calls with 'this.' -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.OrderingRules">
|
||||
<Rule Id="SA1200" Action="None"/> <!-- Using directives should be placed correctly -->
|
||||
<Rule Id="SA1201" Action="Warning"/> <!-- Elements should appear in the correct order -->
|
||||
<Rule Id="SA1202" Action="Warning"/> <!-- Elements should be ordered by access -->
|
||||
<Rule Id="SA1203" Action="Warning"/> <!-- Constants should appear before fields -->
|
||||
<Rule Id="SA1204" Action="Warning"/> <!-- Static elements should appear before instance elements -->
|
||||
<Rule Id="SA1205" Action="Warning"/> <!-- Partial elements should declare access -->
|
||||
<Rule Id="SA1206" Action="Warning"/> <!-- Declaration keywords should follow order -->
|
||||
<Rule Id="SA1207" Action="Warning"/> <!-- Protected should come before internal -->
|
||||
<Rule Id="SA1208" Action="Warning"/> <!-- System using directives should be placed before other using directives -->
|
||||
<Rule Id="SA1209" Action="Warning"/> <!-- Using alias directives should be placed after other using directives -->
|
||||
<Rule Id="SA1210" Action="Warning"/> <!-- Using directives should be ordered alphabetically by namespace -->
|
||||
<Rule Id="SA1211" Action="Warning"/> <!-- Using alias directives should be ordered alphabetically by alias name -->
|
||||
<Rule Id="SA1212" Action="Warning"/> <!-- Property accessors should follow order -->
|
||||
<Rule Id="SA1213" Action="Warning"/> <!-- Event accessors should follow order -->
|
||||
<Rule Id="SA1214" Action="Warning"/> <!-- Readonly fields should appear before non-readonly fields -->
|
||||
<Rule Id="SA1216" Action="Warning"/> <!-- Using static directives should be placed at the correct location -->
|
||||
<Rule Id="SA1217" Action="Warning"/> <!-- Using static directives should be ordered alphabetically -->
|
||||
<Rule Id="SA1200" Action="None" /> <!-- Using directives should be placed correctly -->
|
||||
<Rule Id="SA1201" Action="Warning" /> <!-- Elements should appear in the correct order -->
|
||||
<Rule Id="SA1202" Action="Warning" /> <!-- Elements should be ordered by access -->
|
||||
<Rule Id="SA1203" Action="Warning" /> <!-- Constants should appear before fields -->
|
||||
<Rule Id="SA1204" Action="Warning" /> <!-- Static elements should appear before instance elements -->
|
||||
<Rule Id="SA1205" Action="Warning" /> <!-- Partial elements should declare access -->
|
||||
<Rule Id="SA1206" Action="Warning" /> <!-- Declaration keywords should follow order -->
|
||||
<Rule Id="SA1207" Action="Warning" /> <!-- Protected should come before internal -->
|
||||
<Rule Id="SA1208" Action="Warning" /> <!-- System using directives should be placed before other using directives -->
|
||||
<Rule Id="SA1209" Action="Warning" /> <!-- Using alias directives should be placed after other using directives -->
|
||||
<Rule Id="SA1210" Action="Warning" /> <!-- Using directives should be ordered alphabetically by namespace -->
|
||||
<Rule Id="SA1211" Action="Warning" /> <!-- Using alias directives should be ordered alphabetically by alias name -->
|
||||
<Rule Id="SA1212" Action="Warning" /> <!-- Property accessors should follow order -->
|
||||
<Rule Id="SA1213" Action="Warning" /> <!-- Event accessors should follow order -->
|
||||
<Rule Id="SA1214" Action="Warning" /> <!-- Readonly fields should appear before non-readonly fields -->
|
||||
<Rule Id="SA1216" Action="Warning" /> <!-- Using static directives should be placed at the correct location -->
|
||||
<Rule Id="SA1217" Action="Warning" /> <!-- Using static directives should be ordered alphabetically -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.NamingRules">
|
||||
<Rule Id="SA1300" Action="Warning"/> <!-- Element should begin with upper-case letter -->
|
||||
<Rule Id="SA1301" Action="Warning"/> <!-- Element should begin with lower-case letter -->
|
||||
<Rule Id="SA1302" Action="Warning"/> <!-- Interface names should begin with I -->
|
||||
<Rule Id="SA1303" Action="Warning"/> <!-- Const field names should begin with upper-case letter -->
|
||||
<Rule Id="SA1304" Action="Warning"/> <!-- Non-private readonly fields should begin with upper-case letter -->
|
||||
<Rule Id="SA1305" Action="None"/> <!-- Field names should not use Hungarian notation -->
|
||||
<Rule Id="SA1306" Action="Warning"/> <!-- Field names should begin with lower-case letter -->
|
||||
<Rule Id="SA1307" Action="Warning"/> <!-- Accessible fields should begin with upper-case letter -->
|
||||
<Rule Id="SA1308" Action="Warning"/> <!-- Variable names should not be prefixed -->
|
||||
<Rule Id="SA1309" Action="None"/> <!-- Field names should not begin with underscore -->
|
||||
<Rule Id="SA1310" Action="None"/> <!-- Field names should not contain underscore -->
|
||||
<Rule Id="SA1311" Action="Warning"/> <!-- Static readonly fields should begin with upper-case letter -->
|
||||
<Rule Id="SA1312" Action="Warning"/> <!-- Variable names should begin with lower-case letter -->
|
||||
<Rule Id="SA1313" Action="None"/> <!-- Parameter names should begin with lower-case letter -->
|
||||
<Rule Id="SA1314" Action="Warning"/> <!-- Type parameter names should begin with T -->
|
||||
<Rule Id="SX1309" Action="Warning"/> <!-- Field names should begin with underscore -->
|
||||
<Rule Id="SX1309S" Action="Warning"/> <!-- Static field names should begin with underscore -->
|
||||
<Rule Id="SA1300" Action="Warning" /> <!-- Element should begin with upper-case letter -->
|
||||
<Rule Id="SA1301" Action="Warning" /> <!-- Element should begin with lower-case letter -->
|
||||
<Rule Id="SA1302" Action="Warning" /> <!-- Interface names should begin with I -->
|
||||
<Rule Id="SA1303" Action="Warning" /> <!-- Const field names should begin with upper-case letter -->
|
||||
<Rule Id="SA1304" Action="Warning" /> <!-- Non-private readonly fields should begin with upper-case letter -->
|
||||
<Rule Id="SA1305" Action="None" /> <!-- Field names should not use Hungarian notation -->
|
||||
<Rule Id="SA1306" Action="Warning" /> <!-- Field names should begin with lower-case letter -->
|
||||
<Rule Id="SA1307" Action="Warning" /> <!-- Accessible fields should begin with upper-case letter -->
|
||||
<Rule Id="SA1308" Action="Warning" /> <!-- Variable names should not be prefixed -->
|
||||
<Rule Id="SA1309" Action="None" /> <!-- Field names should not begin with underscore -->
|
||||
<Rule Id="SA1310" Action="None" /> <!-- Field names should not contain underscore -->
|
||||
<Rule Id="SA1311" Action="Warning" /> <!-- Static readonly fields should begin with upper-case letter -->
|
||||
<Rule Id="SA1312" Action="Warning" /> <!-- Variable names should begin with lower-case letter -->
|
||||
<Rule Id="SA1313" Action="Warning" /> <!-- Parameter names should begin with lower-case letter -->
|
||||
<Rule Id="SA1314" Action="Warning" /> <!-- Type parameter names should begin with T -->
|
||||
<Rule Id="SX1309" Action="Warning" /> <!-- Field names should begin with underscore -->
|
||||
<Rule Id="SX1309S" Action="Warning" /> <!-- Static field names should begin with underscore -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.MaintainabilityRules">
|
||||
<Rule Id="SA1119" Action="Warning"/> <!-- Statement should not use unnecessary parenthesis -->
|
||||
<Rule Id="SA1400" Action="Warning"/> <!-- Access modifier should be declared -->
|
||||
<Rule Id="SA1401" Action="Warning"/> <!-- Fields should be private -->
|
||||
<Rule Id="SA1402" Action="Warning"/> <!-- File may only contain a single type -->
|
||||
<Rule Id="SA1403" Action="Warning"/> <!-- File may only contain a single namespace -->
|
||||
<Rule Id="SA1404" Action="Warning"/> <!-- Code analysis suppression should have justification -->
|
||||
<Rule Id="SA1405" Action="Warning"/> <!-- Debug.Assert should provide message text -->
|
||||
<Rule Id="SA1406" Action="Warning"/> <!-- Debug.Fail should provide message text -->
|
||||
<Rule Id="SA1407" Action="None"/> <!-- Arithmetic expressions should declare precedence -->
|
||||
<Rule Id="SA1408" Action="Warning"/> <!-- Conditional expressions should declare precedence -->
|
||||
<Rule Id="SA1409" Action="Warning"/> <!-- Remove unnecessary code -->
|
||||
<Rule Id="SA1410" Action="Warning"/> <!-- Remove delegate parenthesis when possible -->
|
||||
<Rule Id="SA1411" Action="Warning"/> <!-- Attribute constructor should not use unnecessary parenthesis -->
|
||||
<Rule Id="SA1412" Action="None"/> <!-- Store files as UTF-8 with byte order mark -->
|
||||
<Rule Id="SA1413" Action="None"/> <!-- Use trailing comma in multi-line initializers -->
|
||||
<Rule Id="SA1119" Action="Warning" /> <!-- Statement should not use unnecessary parenthesis -->
|
||||
<Rule Id="SA1400" Action="Warning" /> <!-- Access modifier should be declared -->
|
||||
<Rule Id="SA1401" Action="Warning" /> <!-- Fields should be private -->
|
||||
<Rule Id="SA1402" Action="None" /> <!-- File may only contain a single type -->
|
||||
<Rule Id="SA1403" Action="Warning" /> <!-- File may only contain a single namespace -->
|
||||
<Rule Id="SA1404" Action="Warning" /> <!-- Code analysis suppression should have justification -->
|
||||
<Rule Id="SA1405" Action="Warning" /> <!-- Debug.Assert should provide message text -->
|
||||
<Rule Id="SA1406" Action="Warning" /> <!-- Debug.Fail should provide message text -->
|
||||
<Rule Id="SA1407" Action="None" /> <!-- Arithmetic expressions should declare precedence -->
|
||||
<Rule Id="SA1408" Action="Warning" /> <!-- Conditional expressions should declare precedence -->
|
||||
<Rule Id="SA1409" Action="Warning" /> <!-- Remove unnecessary code -->
|
||||
<Rule Id="SA1410" Action="Warning" /> <!-- Remove delegate parenthesis when possible -->
|
||||
<Rule Id="SA1411" Action="Warning" /> <!-- Attribute constructor should not use unnecessary parenthesis -->
|
||||
<Rule Id="SA1412" Action="None" /> <!-- Store files as UTF-8 with byte order mark -->
|
||||
<Rule Id="SA1413" Action="None" /> <!-- Use trailing comma in multi-line initializers -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.LayoutRules">
|
||||
<Rule Id="SA1500" Action="None"/> <!-- Braces for multi-line statements should not share line -->
|
||||
<Rule Id="SA1501" Action="Warning"/> <!-- Statement should not be on a single line -->
|
||||
<Rule Id="SA1502" Action="None"/> <!-- Element should not be on a single line -->
|
||||
<Rule Id="SA1503" Action="None"/> <!-- Braces should not be omitted -->
|
||||
<Rule Id="SA1504" Action="Warning"/> <!-- All accessors should be single-line or multi-line -->
|
||||
<Rule Id="SA1505" Action="Warning"/> <!-- Opening braces should not be followed by blank line -->
|
||||
<Rule Id="SA1506" Action="Warning"/> <!-- Element documentation headers should not be followed by blank line -->
|
||||
<Rule Id="SA1507" Action="Warning"/> <!-- Code should not contain multiple blank lines in a row -->
|
||||
<Rule Id="SA1508" Action="Warning"/> <!-- Closing braces should not be preceded by blank line -->
|
||||
<Rule Id="SA1509" Action="Warning"/> <!-- Opening braces should not be preceded by blank line -->
|
||||
<Rule Id="SA1510" Action="Warning"/> <!-- Chained statement blocks should not be preceded by blank line -->
|
||||
<Rule Id="SA1511" Action="Warning"/> <!-- While-do footer should not be preceded by blank line -->
|
||||
<Rule Id="SA1512" Action="Warning"/> <!-- Single-line comments should not be followed by blank line -->
|
||||
<Rule Id="SA1513" Action="Warning"/> <!-- Closing brace should be followed by blank line -->
|
||||
<Rule Id="SA1514" Action="Warning"/> <!-- Element documentation header should be preceded by blank line -->
|
||||
<Rule Id="SA1515" Action="Warning"/> <!-- Single-line comment should be preceded by blank line -->
|
||||
<Rule Id="SA1516" Action="Warning"/> <!-- Elements should be separated by blank line -->
|
||||
<Rule Id="SA1517" Action="Warning"/> <!-- Code should not contain blank lines at start of file -->
|
||||
<Rule Id="SA1518" Action="Warning"/> <!-- Use line endings correctly at end of file -->
|
||||
<Rule Id="SA1519" Action="Warning"/> <!-- Braces should not be omitted from multi-line child statement -->
|
||||
<Rule Id="SA1520" Action="Warning"/> <!-- Use braces consistently -->
|
||||
<Rule Id="SA1500" Action="None" /> <!-- Braces for multi-line statements should not share line -->
|
||||
<Rule Id="SA1501" Action="Warning" /> <!-- Statement should not be on a single line -->
|
||||
<Rule Id="SA1502" Action="None" /> <!-- Element should not be on a single line -->
|
||||
<Rule Id="SA1503" Action="Warning" /> <!-- Braces should not be omitted -->
|
||||
<Rule Id="SA1504" Action="Warning" /> <!-- All accessors should be single-line or multi-line -->
|
||||
<Rule Id="SA1505" Action="Warning" /> <!-- Opening braces should not be followed by blank line -->
|
||||
<Rule Id="SA1506" Action="Warning" /> <!-- Element documentation headers should not be followed by blank line -->
|
||||
<Rule Id="SA1507" Action="Warning" /> <!-- Code should not contain multiple blank lines in a row -->
|
||||
<Rule Id="SA1508" Action="Warning" /> <!-- Closing braces should not be preceded by blank line -->
|
||||
<Rule Id="SA1509" Action="Warning" /> <!-- Opening braces should not be preceded by blank line -->
|
||||
<Rule Id="SA1510" Action="Warning" /> <!-- Chained statement blocks should not be preceded by blank line -->
|
||||
<Rule Id="SA1511" Action="Warning" /> <!-- While-do footer should not be preceded by blank line -->
|
||||
<Rule Id="SA1512" Action="Warning" /> <!-- Single-line comments should not be followed by blank line -->
|
||||
<Rule Id="SA1513" Action="Warning" /> <!-- Closing brace should be followed by blank line -->
|
||||
<Rule Id="SA1514" Action="Warning" /> <!-- Element documentation header should be preceded by blank line -->
|
||||
<Rule Id="SA1515" Action="Warning" /> <!-- Single-line comment should be preceded by blank line -->
|
||||
<Rule Id="SA1516" Action="Warning" /> <!-- Elements should be separated by blank line -->
|
||||
<Rule Id="SA1517" Action="Warning" /> <!-- Code should not contain blank lines at start of file -->
|
||||
<Rule Id="SA1518" Action="Warning" /> <!-- Use line endings correctly at end of file -->
|
||||
<Rule Id="SA1519" Action="Warning" /> <!-- Braces should not be omitted from multi-line child statement -->
|
||||
<Rule Id="SA1520" Action="Warning" /> <!-- Use braces consistently -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.DocumentationRules">
|
||||
<Rule Id="SA1600" Action="None"/> <!-- Elements should be documented -->
|
||||
<Rule Id="SA1601" Action="None"/> <!-- Partial elements should be documented -->
|
||||
<Rule Id="SA1602" Action="None"/> <!-- Enumeration items should be documented -->
|
||||
<Rule Id="SA1603" Action="Warning"/> <!-- Documentation should contain valid XML -->
|
||||
<Rule Id="SA1604" Action="Warning"/> <!-- Element documentation should have summary -->
|
||||
<Rule Id="SA1605" Action="Warning"/> <!-- Partial element documentation should have summary -->
|
||||
<Rule Id="SA1606" Action="Warning"/> <!-- Element documentation should have summary text -->
|
||||
<Rule Id="SA1607" Action="Warning"/> <!-- Partial element documentation should have summary text -->
|
||||
<Rule Id="SA1608" Action="Warning"/> <!-- Element documentation should not have default summary -->
|
||||
<Rule Id="SA1609" Action="Warning"/> <!-- Property documentation should have value -->
|
||||
<Rule Id="SA1610" Action="Warning"/> <!-- Property documentation should have value text -->
|
||||
<Rule Id="SA1611" Action="None"/> <!-- Element parameters should be documented -->
|
||||
<Rule Id="SA1612" Action="Warning"/> <!-- Element parameter documentation should match element parameters -->
|
||||
<Rule Id="SA1613" Action="Warning"/> <!-- Element parameter documentation should declare parameter name -->
|
||||
<Rule Id="SA1614" Action="Warning"/> <!-- Element parameter documentation should have text -->
|
||||
<Rule Id="SA1615" Action="None"/> <!-- Element return value should be documented -->
|
||||
<Rule Id="SA1616" Action="Warning"/> <!-- Element return value documentation should have text -->
|
||||
<Rule Id="SA1617" Action="Warning"/> <!-- Void return value should not be documented -->
|
||||
<Rule Id="SA1618" Action="None"/> <!-- Generic type parameters should be documented -->
|
||||
<Rule Id="SA1619" Action="None"/> <!-- Generic type parameters should be documented partial class -->
|
||||
<Rule Id="SA1620" Action="Warning"/> <!-- Generic type parameter documentation should match type parameters -->
|
||||
<Rule Id="SA1621" Action="Warning"/> <!-- Generic type parameter documentation should declare parameter name -->
|
||||
<Rule Id="SA1622" Action="Warning"/> <!-- Generic type parameter documentation should have text -->
|
||||
<Rule Id="SA1623" Action="Warning"/> <!-- Property summary documentation should match accessors -->
|
||||
<Rule Id="SA1624" Action="Warning"/> <!-- Property summary documentation should omit accessor with restricted access -->
|
||||
<Rule Id="SA1625" Action="Warning"/> <!-- Element documentation should not be copied and pasted -->
|
||||
<Rule Id="SA1626" Action="Warning"/> <!-- Single-line comments should not use documentation style slashes -->
|
||||
<Rule Id="SA1627" Action="Warning"/> <!-- Documentation text should not be empty -->
|
||||
<Rule Id="SA1628" Action="Warning"/> <!-- Documentation text should begin with a capital letter -->
|
||||
<Rule Id="SA1629" Action="Warning"/> <!-- Documentation text should end with a period -->
|
||||
<Rule Id="SA1630" Action="Warning"/> <!-- Documentation text should contain whitespace -->
|
||||
<Rule Id="SA1631" Action="Warning"/> <!-- Documentation should meet character percentage -->
|
||||
<Rule Id="SA1632" Action="Warning"/> <!-- Documentation text should meet minimum character length -->
|
||||
<Rule Id="SA1633" Action="None"/> <!-- File should have header -->
|
||||
<Rule Id="SA1634" Action="Warning"/> <!-- File header should show copyright -->
|
||||
<Rule Id="SA1635" Action="Warning"/> <!-- File header should have copyright text -->
|
||||
<Rule Id="SA1636" Action="Warning"/> <!-- File header copyright text should match -->
|
||||
<Rule Id="SA1637" Action="Warning"/> <!-- File header should contain file name -->
|
||||
<Rule Id="SA1638" Action="Warning"/> <!-- File header file name documentation should match file name -->
|
||||
<Rule Id="SA1639" Action="Warning"/> <!-- File header should have summary -->
|
||||
<Rule Id="SA1640" Action="Warning"/> <!-- File header should have valid company text -->
|
||||
<Rule Id="SA1641" Action="Warning"/> <!-- File header company name text should match -->
|
||||
<Rule Id="SA1642" Action="Warning"/> <!-- Constructor summary documentation should begin with standard text -->
|
||||
<Rule Id="SA1643" Action="Warning"/> <!-- Destructor summary documentation should begin with standard text -->
|
||||
<Rule Id="SA1644" Action="Warning"/> <!-- Documentation headers should not contain blank lines -->
|
||||
<Rule Id="SA1645" Action="Warning"/> <!-- Included documentation file does not exist -->
|
||||
<Rule Id="SA1646" Action="Warning"/> <!-- Included documentation XPath does not exist -->
|
||||
<Rule Id="SA1647" Action="Warning"/> <!-- Include node does not contain valid file and path -->
|
||||
<Rule Id="SA1648" Action="Warning"/> <!-- Inheritdoc should be used with inheriting class -->
|
||||
<Rule Id="SA1649" Action="Warning"/> <!-- File name should match first type name -->
|
||||
<Rule Id="SA1650" Action="Warning"/> <!-- Element documentation should be spelled correctly -->
|
||||
<Rule Id="SA1651" Action="Warning"/> <!-- Do not use placeholder elements -->
|
||||
|
||||
<Rule Id="SA1600" Action="None" /> <!-- Elements should be documented -->
|
||||
<Rule Id="SA1601" Action="None" /> <!-- Partial elements should be documented -->
|
||||
<Rule Id="SA1602" Action="None" /> <!-- Enumeration items should be documented -->
|
||||
<Rule Id="SA1603" Action="Warning" /> <!-- Documentation should contain valid XML -->
|
||||
<Rule Id="SA1604" Action="Warning" /> <!-- Element documentation should have summary -->
|
||||
<Rule Id="SA1605" Action="Warning" /> <!-- Partial element documentation should have summary -->
|
||||
<Rule Id="SA1606" Action="Warning" /> <!-- Element documentation should have summary text -->
|
||||
<Rule Id="SA1607" Action="Warning" /> <!-- Partial element documentation should have summary text -->
|
||||
<Rule Id="SA1608" Action="Warning" /> <!-- Element documentation should not have default summary -->
|
||||
<Rule Id="SA1609" Action="None" /> <!-- Property documentation should have value -->
|
||||
<Rule Id="SA1610" Action="Warning" /> <!-- Property documentation should have value text -->
|
||||
<Rule Id="SA1611" Action="None" /> <!-- Element parameters should be documented -->
|
||||
<Rule Id="SA1612" Action="Warning" /> <!-- Element parameter documentation should match element parameters -->
|
||||
<Rule Id="SA1613" Action="Warning" /> <!-- Element parameter documentation should declare parameter name -->
|
||||
<Rule Id="SA1614" Action="Warning" /> <!-- Element parameter documentation should have text -->
|
||||
<Rule Id="SA1615" Action="None" /> <!-- Element return value should be documented -->
|
||||
<Rule Id="SA1616" Action="Warning" /> <!-- Element return value documentation should have text -->
|
||||
<Rule Id="SA1617" Action="Warning" /> <!-- Void return value should not be documented -->
|
||||
<Rule Id="SA1618" Action="None" /> <!-- Generic type parameters should be documented -->
|
||||
<Rule Id="SA1619" Action="None" /> <!-- Generic type parameters should be documented partial class -->
|
||||
<Rule Id="SA1620" Action="Warning" /> <!-- Generic type parameter documentation should match type parameters -->
|
||||
<Rule Id="SA1621" Action="Warning" /> <!-- Generic type parameter documentation should declare parameter name -->
|
||||
<Rule Id="SA1622" Action="Warning" /> <!-- Generic type parameter documentation should have text -->
|
||||
<Rule Id="SA1623" Action="None" /> <!-- Property summary documentation should match accessors -->
|
||||
<Rule Id="SA1624" Action="Warning" /> <!-- Property summary documentation should omit accessor with restricted access -->
|
||||
<Rule Id="SA1625" Action="Warning" /> <!-- Element documentation should not be copied and pasted -->
|
||||
<Rule Id="SA1626" Action="Warning" /> <!-- Single-line comments should not use documentation style slashes -->
|
||||
<Rule Id="SA1627" Action="Warning" /> <!-- Documentation text should not be empty -->
|
||||
<Rule Id="SA1628" Action="Warning" /> <!-- Documentation text should begin with a capital letter -->
|
||||
<Rule Id="SA1629" Action="None" /> <!-- Documentation text should end with a period -->
|
||||
<Rule Id="SA1630" Action="Warning" /> <!-- Documentation text should contain whitespace -->
|
||||
<Rule Id="SA1631" Action="Warning" /> <!-- Documentation should meet character percentage -->
|
||||
<Rule Id="SA1632" Action="Warning" /> <!-- Documentation text should meet minimum character length -->
|
||||
<Rule Id="SA1633" Action="None" /> <!-- File should have header -->
|
||||
<Rule Id="SA1634" Action="Warning" /> <!-- File header should show copyright -->
|
||||
<Rule Id="SA1635" Action="Warning" /> <!-- File header should have copyright text -->
|
||||
<Rule Id="SA1636" Action="Warning" /> <!-- File header copyright text should match -->
|
||||
<Rule Id="SA1637" Action="Warning" /> <!-- File header should contain file name -->
|
||||
<Rule Id="SA1638" Action="Warning" /> <!-- File header file name documentation should match file name -->
|
||||
<Rule Id="SA1639" Action="Warning" /> <!-- File header should have summary -->
|
||||
<Rule Id="SA1640" Action="Warning" /> <!-- File header should have valid company text -->
|
||||
<Rule Id="SA1641" Action="Warning" /> <!-- File header company name text should match -->
|
||||
<Rule Id="SA1642" Action="Warning" /> <!-- Constructor summary documentation should begin with standard text -->
|
||||
<Rule Id="SA1643" Action="Warning" /> <!-- Destructor summary documentation should begin with standard text -->
|
||||
<Rule Id="SA1644" Action="Warning" /> <!-- Documentation headers should not contain blank lines -->
|
||||
<Rule Id="SA1645" Action="Warning" /> <!-- Included documentation file does not exist -->
|
||||
<Rule Id="SA1646" Action="Warning" /> <!-- Included documentation XPath does not exist -->
|
||||
<Rule Id="SA1647" Action="Warning" /> <!-- Include node does not contain valid file and path -->
|
||||
<Rule Id="SA1648" Action="Warning" /> <!-- Inheritdoc should be used with inheriting class -->
|
||||
<Rule Id="SA1649" Action="Warning" /> <!-- File name should match first type name -->
|
||||
<Rule Id="SA1650" Action="Warning" /> <!-- Element documentation should be spelled correctly -->
|
||||
<Rule Id="SA1651" Action="Warning" /> <!-- Do not use placeholder elements -->
|
||||
</Rules>
|
||||
</RuleSet>
|
@ -6,7 +6,7 @@ var slnFile = Directory.GetFiles(@".", "*.sln").First();
|
||||
$"""
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
{string.Join('\n',
|
||||
Directory.GetFiles(@".", "*").Where(x => !x.EndsWith(".sln"))
|
||||
Directory.GetFiles(@".", "*").Where(x => !x.EndsWith(".sln") && !x.EndsWith(".user"))
|
||||
.Select(x=>$"\t\t{Path.GetFileName(x)} = {Path.GetFileName(x)}"))}
|
||||
{'\t'}EndProjectSection
|
||||
""");
|
4
dot.sln
4
dot.sln
@ -11,7 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{AD79881E-7
|
||||
.gitattributes = .gitattributes
|
||||
.gitignore = .gitignore
|
||||
.tgitconfig = .tgitconfig
|
||||
AddMetaFilesToSln.csx = AddMetaFilesToSln.csx
|
||||
build.cake = build.cake
|
||||
code-format.cmd = code-format.cmd
|
||||
CodeCleanupOnSave.csx = CodeCleanupOnSave.csx
|
||||
@ -31,7 +30,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{AD79881E-7
|
||||
StyleCopAnalyzers.ruleset = StyleCopAnalyzers.ruleset
|
||||
switch-nuget.cmd = switch-nuget.cmd
|
||||
switch-project.cmd = switch-project.cmd
|
||||
switcher.json = switcher.json
|
||||
switcher.nsext.json = switcher.nsext.json
|
||||
SyncMetaFiles.csx = SyncMetaFiles.csx
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests\tests.csproj", "{15EF00AD-DFA8-4BE2-985E-85DA8092CB2F}"
|
||||
|
@ -1,4 +1,10 @@
|
||||
<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">
|
||||
<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:Boolean x:Key="/Default/ReSpeller/ReSpellerEnabled/@EntryValue">False</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>
|
||||
|
@ -4,8 +4,8 @@ using System.Runtime.Versioning;
|
||||
|
||||
namespace Dot.Color;
|
||||
|
||||
[Description(nameof(Str.ScreenPixelTool))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.ScreenPixelTool))]
|
||||
[Localization(typeof(Ln))]
|
||||
[SupportedOSPlatform(nameof(OSPlatform.Windows))]
|
||||
|
||||
// ReSharper disable once ClassNeverInstantiated.Global
|
||||
|
@ -9,8 +9,8 @@ namespace Dot.Color;
|
||||
[SupportedOSPlatform(nameof(OSPlatform.Windows))]
|
||||
internal sealed class WinInfo : Form
|
||||
{
|
||||
private const int _WINDOW_SIZE = 480; //窗口大小
|
||||
private const int _ZOOM_RATE = 16; //缩放倍率
|
||||
private const int _WINDOW_SIZE = 480; // 窗口大小
|
||||
private const int _ZOOM_RATE = 16; // 缩放倍率
|
||||
private readonly Graphics _graphics;
|
||||
private readonly PictureBox _pbox;
|
||||
private bool _disposed;
|
||||
@ -29,7 +29,7 @@ internal sealed class WinInfo : Form
|
||||
_pbox.Size = Size;
|
||||
_pbox.Image = new Bitmap(_WINDOW_SIZE, _WINDOW_SIZE);
|
||||
_graphics = Graphics.FromImage(_pbox.Image);
|
||||
_graphics.InterpolationMode = InterpolationMode.NearestNeighbor; //指定最临近插值法,禁止平滑缩放(模糊)
|
||||
_graphics.InterpolationMode = InterpolationMode.NearestNeighbor; // 指定最临近插值法,禁止平滑缩放(模糊)
|
||||
_graphics.CompositingQuality = CompositingQuality.HighQuality;
|
||||
_graphics.SmoothingMode = SmoothingMode.None;
|
||||
_pbox.MouseEnter += PboxOnMouseEnter;
|
||||
@ -49,7 +49,7 @@ internal sealed class WinInfo : Form
|
||||
, x - copySize.Width / 2 // 左移x,使光标位置居中
|
||||
, y - copySize.Height / 2 // 上移y,使光标位置居中
|
||||
, copySize.Width, copySize.Height, GraphicsUnit.Pixel);
|
||||
using var pen = new Pen(System.Drawing.Color.Aqua); //绘制准星
|
||||
using var pen = new Pen(System.Drawing.Color.Aqua); // 绘制准星
|
||||
_graphics.DrawRectangle(pen, _WINDOW_SIZE / 2 - _ZOOM_RATE / 2 //
|
||||
, _WINDOW_SIZE / 2 - _ZOOM_RATE / 2 //
|
||||
, _ZOOM_RATE, _ZOOM_RATE);
|
||||
@ -60,7 +60,7 @@ internal sealed class WinInfo : Form
|
||||
// 绘制底部文字信息
|
||||
_graphics.FillRectangle(Brushes.Black, 0, _WINDOW_SIZE - 30, _WINDOW_SIZE, 30);
|
||||
_graphics.DrawString( //
|
||||
$"{Str.ClickCopyColor} X: {x} Y: {y} RGB({posColor.R},{posColor.G},{posColor.B})"
|
||||
$"{Ln.ClickCopyColor} X: {x} Y: {y} RGB({posColor.R},{posColor.G},{posColor.B})"
|
||||
, new Font(FontFamily.GenericSerif, 10) //
|
||||
, Brushes.White, 0, _WINDOW_SIZE - 20);
|
||||
|
||||
|
@ -10,7 +10,7 @@ namespace Dot.Color;
|
||||
internal sealed class WinMain : Form
|
||||
{
|
||||
private readonly Bitmap _bmp;
|
||||
private readonly WinInfo _winInfo = new(); //小图窗口
|
||||
private readonly WinInfo _winInfo = new(); // 小图窗口
|
||||
|
||||
private bool _disposed;
|
||||
|
||||
@ -23,7 +23,7 @@ internal sealed class WinMain : Form
|
||||
Size = Screen.PrimaryScreen!.Bounds.Size;
|
||||
StartPosition = FormStartPosition.Manual;
|
||||
Location = new Point(0, 0);
|
||||
Opacity = 0.01d; //主窗体加载截图过程设置为透明避免闪烁
|
||||
Opacity = 0.01d; // 主窗体加载截图过程设置为透明避免闪烁
|
||||
_bmp = new Bitmap(Size.Width, Size.Height);
|
||||
using var g = Graphics.FromImage(_bmp);
|
||||
g.CopyFromScreen(0, 0, 0, 0, Size);
|
||||
|
@ -5,31 +5,31 @@ namespace Dot;
|
||||
internal class DirOption : OptionBase
|
||||
{
|
||||
[CommandOption("-e|--exclude")]
|
||||
[Description(nameof(Str.ExcludePathRegexes))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.ExcludePathRegexes))]
|
||||
[Localization(typeof(Ln))]
|
||||
public IEnumerable<string> ExcludeRegexes { get; set; }
|
||||
|
||||
[CommandOption("-f|--filter")]
|
||||
[Description(nameof(Str.FileSearchPattern))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.FileSearchPattern))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue("*")]
|
||||
public string Filter { get; set; }
|
||||
|
||||
[CommandOption("-d|--max-depth")]
|
||||
[Description(nameof(Str.MaxRecursionDepth))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.MaxRecursionDepth))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(int.MaxValue)]
|
||||
public int MaxRecursionDepth { get; set; }
|
||||
|
||||
[CommandArgument(0, "[path]")]
|
||||
[Description(nameof(Str.FolderPath))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.FolderPath))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(".")]
|
||||
public string Path { get; set; }
|
||||
|
||||
[CommandOption("-w|--write")]
|
||||
[Description(nameof(Str.WriteMode))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.WriteMode))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(false)]
|
||||
public bool WriteMode { get; set; }
|
||||
}
|
@ -10,14 +10,14 @@ internal abstract class FilesTool<TOption> : ToolBase<TOption>
|
||||
where TOption : DirOption
|
||||
{
|
||||
// ReSharper disable once StaticMemberInGenericType
|
||||
private static readonly object _lock = new(); //线程锁
|
||||
private readonly ConcurrentDictionary<string, int> _writeStats = new(); //写入统计:后缀,数量
|
||||
private int _breakCnt; //跳过文件数
|
||||
private ProgressTask _childTask; //子任务进度
|
||||
private int _excludeCnt; //排除文件数
|
||||
private int _readCnt; //读取文件数
|
||||
private int _totalCnt; //总文件数
|
||||
private int _writeCnt; //写入文件数
|
||||
private static readonly object _lock = new(); // 线程锁
|
||||
private readonly ConcurrentDictionary<string, int> _writeStats = new(); // 写入统计:后缀,数量
|
||||
private int _breakCnt; // 跳过文件数
|
||||
private ProgressTask _childTask; // 子任务进度
|
||||
private int _excludeCnt; // 排除文件数
|
||||
private int _readCnt; // 读取文件数
|
||||
private int _totalCnt; // 总文件数
|
||||
private int _writeCnt; // 写入文件数
|
||||
|
||||
protected static FileStream CreateTempFile(out string file)
|
||||
{
|
||||
@ -52,7 +52,7 @@ internal abstract class FilesTool<TOption> : ToolBase<TOption>
|
||||
{
|
||||
return !Directory.Exists(Opt.Path)
|
||||
? throw new ArgumentException( //
|
||||
nameof(Opt.Path), string.Format(CultureInfo.InvariantCulture, Str.PathNotFound, Opt.Path))
|
||||
nameof(Opt.Path), string.Format(CultureInfo.InvariantCulture, Ln.PathNotFound, Opt.Path))
|
||||
: CoreInternal();
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ internal abstract class FilesTool<TOption> : ToolBase<TOption>
|
||||
}
|
||||
|
||||
_childTask.Description
|
||||
= $"{Str.Read}: [green]{_readCnt}[/]/{_totalCnt}, {Str.Write}: [red]{_writeCnt}[/], {Str.Break}: [gray]{_breakCnt}[/], {Str.Exclude}: [yellow]{_excludeCnt}[/]";
|
||||
= $"{Ln.Read}: [green]{_readCnt}[/]/{_totalCnt}, {Ln.Write}: [red]{_writeCnt}[/], {Ln.Break}: [gray]{_breakCnt}[/], {Ln.Exclude}: [yellow]{_excludeCnt}[/]";
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ internal abstract class FilesTool<TOption> : ToolBase<TOption>
|
||||
private async Task CoreInternal()
|
||||
{
|
||||
if (!Opt.WriteMode) {
|
||||
AnsiConsole.MarkupLine(CultureInfo.InvariantCulture, "[gray]{0}[/]", Str.ExerciseMode);
|
||||
AnsiConsole.MarkupLine(CultureInfo.InvariantCulture, "[gray]{0}[/]", Ln.ExerciseMode);
|
||||
}
|
||||
|
||||
IEnumerable<string> fileList;
|
||||
@ -93,7 +93,7 @@ internal abstract class FilesTool<TOption> : ToolBase<TOption>
|
||||
, new SpinnerColumn() //
|
||||
, new TaskDescriptionColumn { Alignment = Justify.Left }) //
|
||||
.StartAsync(async ctx => {
|
||||
var taskSearchfile = ctx.AddTask(Str.SearchingFile).IsIndeterminate();
|
||||
var taskSearchfile = ctx.AddTask(Ln.SearchingFile).IsIndeterminate();
|
||||
_childTask = ctx.AddTask("-/-", false);
|
||||
fileList = EnumerateFiles(Opt.Path, Opt.Filter, out _excludeCnt);
|
||||
_totalCnt = fileList.Count();
|
||||
@ -111,7 +111,7 @@ internal abstract class FilesTool<TOption> : ToolBase<TOption>
|
||||
_ = grid.AddRow(kv.Key, kv.Value.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
AnsiConsole.Write(new Panel(grid).Header(Str.WriteFileStats));
|
||||
AnsiConsole.Write(new Panel(grid).Header(Ln.WriteFileStats));
|
||||
}
|
||||
|
||||
// ReSharper disable once ReturnTypeCanBeEnumerable.Local
|
||||
@ -119,7 +119,7 @@ internal abstract class FilesTool<TOption> : ToolBase<TOption>
|
||||
{
|
||||
var exCnt = 0;
|
||||
|
||||
//默认排除.git 、 node_modules 目录
|
||||
// 默认排除.git 、 node_modules 目录
|
||||
if (Opt.ExcludeRegexes?.FirstOrDefault() is null) {
|
||||
Opt.ExcludeRegexes = new[] { @"\.git", "node_modules" };
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ using NSExt.Extensions;
|
||||
|
||||
namespace Dot.Get;
|
||||
|
||||
[Description(nameof(Str.DownloadTool))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.DownloadTool))]
|
||||
[Localization(typeof(Ln))]
|
||||
internal sealed partial class Main : ToolBase<Option>
|
||||
{
|
||||
private const string _PART = "part";
|
||||
@ -17,11 +17,11 @@ internal sealed partial class Main : ToolBase<Option>
|
||||
using var http = new HttpClient();
|
||||
string attachment = default;
|
||||
long contentLength = default;
|
||||
var table = new Table().AddColumn(Str.DataIdentification).AddColumn(Str.DataContent).AddRow("Url", Opt.Url);
|
||||
var table = new Table().AddColumn(Ln.DataIdentification).AddColumn(Ln.DataContent).AddRow("Url", Opt.Url);
|
||||
await AnsiConsole.Status()
|
||||
.AutoRefresh(true)
|
||||
.Spinner(Spinner.Known.Default)
|
||||
.StartAsync($"{Str.RequestMetaData}: {Opt.Url}", async _ => {
|
||||
.StartAsync($"{Ln.RequestMetaData}: {Opt.Url}", async _ => {
|
||||
using var headRsp = await http.SendAsync(new HttpRequestMessage(HttpMethod.Head, Opt.Url));
|
||||
using var content = headRsp.Content;
|
||||
contentLength = content.Headers.ContentLength ?? 0;
|
||||
@ -45,15 +45,15 @@ internal sealed partial class Main : ToolBase<Option>
|
||||
, new TaskDescriptionColumn() //
|
||||
, new RemainingTimeColumn()) //
|
||||
.StartAsync(async ctx => {
|
||||
var tParent = ctx.AddTask($"{Str.TotalProgress} {Str.RemainingTime}:").IsIndeterminate();
|
||||
var tParent = ctx.AddTask($"{Ln.TotalProgress} {Ln.RemainingTime}:").IsIndeterminate();
|
||||
|
||||
//未知文件长度,单线程下载;
|
||||
// 未知文件长度,单线程下载;
|
||||
if (contentLength == 0) {
|
||||
await using var nets = await http.GetStreamAsync(Opt.Url);
|
||||
await using var fs
|
||||
= new FileStream(mainFilePath, FileMode.CreateNew, FileAccess.Write
|
||||
, FileShare.None);
|
||||
tParent.MaxValue = Opt.BufferSize + 1; //由于文件长度未知, 进度条终点永远至为当前长度+1
|
||||
tParent.MaxValue = Opt.BufferSize + 1; // 由于文件长度未知, 进度条终点永远至为当前长度+1
|
||||
StreamCopy(nets, fs, x => {
|
||||
tParent.MaxValue += x;
|
||||
tParent.Increment(x);
|
||||
@ -63,7 +63,7 @@ internal sealed partial class Main : ToolBase<Option>
|
||||
tParent.StopTask();
|
||||
}
|
||||
|
||||
//已知文件长度,多线程下载:
|
||||
// 已知文件长度,多线程下载:
|
||||
else {
|
||||
tParent.IsIndeterminate(false);
|
||||
tParent.MaxValue = contentLength;
|
||||
@ -73,7 +73,7 @@ internal sealed partial class Main : ToolBase<Option>
|
||||
, new ParallelOptions { MaxDegreeOfParallelism = Opt.MaxParallel } //
|
||||
, i => {
|
||||
var tChild = ctx.AddTask(
|
||||
$"{Str.Thread}{i} {Str.RemainingTime}:", maxValue: chunkSize);
|
||||
$"{Ln.Thread}{i} {Ln.RemainingTime}:", maxValue: chunkSize);
|
||||
using var getReq = new HttpRequestMessage(HttpMethod.Get, Opt.Url);
|
||||
var startPos = i * chunkSize;
|
||||
var endPos = startPos + chunkSize - 1;
|
||||
@ -97,7 +97,7 @@ internal sealed partial class Main : ToolBase<Option>
|
||||
});
|
||||
|
||||
AnsiConsole.MarkupLine(
|
||||
$"{Str.DownloadCompleted}, {Str.ElapsedTime}: {DateTime.Now - timer}, {Str.FileSaveLocation}: {mainFilePath}");
|
||||
$"{Ln.DownloadCompleted}, {Ln.ElapsedTime}: {DateTime.Now - timer}, {Ln.FileSaveLocation}: {mainFilePath}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -114,7 +114,7 @@ internal sealed partial class Main : ToolBase<Option>
|
||||
}
|
||||
|
||||
// ReSharper disable once InvertIf
|
||||
if (Directory.Exists(path)) { //path 是一个存在的目录。
|
||||
if (Directory.Exists(path)) { // path 是一个存在的目录。
|
||||
path = Path.Combine(path, file); // 构建文件路径
|
||||
GetUseablePath(ref path); // 追加序号。
|
||||
return path;
|
||||
|
@ -6,31 +6,31 @@ namespace Dot.Get;
|
||||
internal sealed class Option : OptionBase
|
||||
{
|
||||
[CommandOption("-b|--buffer-size")]
|
||||
[Description(nameof(Str.BufferSize))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.BufferSize))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(8096)]
|
||||
public int BufferSize { get; set; }
|
||||
|
||||
[CommandOption("-c|--chunk-number")]
|
||||
[Description(nameof(Str.ChunkNumbers))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.ChunkNumbers))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(5)]
|
||||
public int ChunkNumbers { get; set; }
|
||||
|
||||
[CommandOption("-m|--max-parallel")]
|
||||
[Description(nameof(Str.MaxParallel))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.MaxParallel))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(5)]
|
||||
public int MaxParallel { get; set; }
|
||||
|
||||
[CommandOption("-o|--output")]
|
||||
[Description(nameof(Str.OutputPath))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.OutputPath))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(".")]
|
||||
public string Output { get; set; }
|
||||
|
||||
[CommandArgument(0, "<url>")]
|
||||
[Description(nameof(Str.Url))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.Url))]
|
||||
[Localization(typeof(Ln))]
|
||||
public string Url { get; set; }
|
||||
}
|
@ -7,12 +7,12 @@ using NSExt.Extensions;
|
||||
|
||||
namespace Dot.Git;
|
||||
|
||||
[Description(nameof(Str.GitTool))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.GitTool))]
|
||||
[Localization(typeof(Ln))]
|
||||
internal sealed class Main : ToolBase<Option>
|
||||
{
|
||||
private Encoding _gitOutputEnc; //git command rsp 编码
|
||||
private ConcurrentDictionary<string, StringBuilder> _repoRsp; //仓库信息容器
|
||||
private Encoding _gitOutputEnc; // git command rsp 编码
|
||||
private ConcurrentDictionary<string, StringBuilder> _repoRsp; // 仓库信息容器
|
||||
private ConcurrentDictionary<string, TaskStatusColumn.Statues> _repoStatus;
|
||||
|
||||
protected override Task Core()
|
||||
@ -20,7 +20,7 @@ internal sealed class Main : ToolBase<Option>
|
||||
return !Directory.Exists(Opt.Path)
|
||||
? throw new ArgumentException( //
|
||||
nameof(Opt.Path) //
|
||||
, string.Format(CultureInfo.InvariantCulture, Str.PathNotFound, Opt.Path))
|
||||
, string.Format(CultureInfo.InvariantCulture, Ln.PathNotFound, Opt.Path))
|
||||
: CoreInternal();
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ internal sealed class Main : ToolBase<Option>
|
||||
, new TaskDescriptionColumn { Alignment = Justify.Left }) //
|
||||
.StartAsync(async ctx => {
|
||||
var taskFinder = ctx
|
||||
.AddTask(string.Format(CultureInfo.InvariantCulture, Str.FindGitReps
|
||||
.AddTask(string.Format(CultureInfo.InvariantCulture, Ln.FindGitReps
|
||||
, Opt.Path))
|
||||
.IsIndeterminate();
|
||||
var paths = Directory.GetDirectories(Opt.Path, ".git" //
|
||||
@ -66,11 +66,11 @@ internal sealed class Main : ToolBase<Option>
|
||||
await Parallel.ForEachAsync(tasks, DirHandle);
|
||||
});
|
||||
|
||||
var table = new Table().AddColumn(new TableColumn(Str.Repository) { Width = 50 })
|
||||
.AddColumn(new TableColumn(Str.Command))
|
||||
.AddColumn(new TableColumn(Str.Response) { Width = 50 })
|
||||
var table = new Table().AddColumn(new TableColumn(Ln.Repository) { Width = 50 })
|
||||
.AddColumn(new TableColumn(Ln.Command))
|
||||
.AddColumn(new TableColumn(Ln.Response) { Width = 50 })
|
||||
.Caption(
|
||||
$"{Str.ZeroCode}: [green]{_repoStatus.Count(x => x.Value == TaskStatusColumn.Statues
|
||||
$"{Ln.ZeroCode}: [green]{_repoStatus.Count(x => x.Value == TaskStatusColumn.Statues
|
||||
.Succeed)}[/]/{_repoStatus.Count}");
|
||||
|
||||
foreach (var repo in _repoRsp) {
|
||||
@ -82,7 +82,9 @@ internal sealed class Main : ToolBase<Option>
|
||||
AnsiConsole.Write(table);
|
||||
}
|
||||
|
||||
#pragma warning disable SA1313
|
||||
private async ValueTask DirHandle(KeyValuePair<string, ProgressTask> payload, CancellationToken _)
|
||||
#pragma warning restore SA1313
|
||||
{
|
||||
payload.Value.StartTask();
|
||||
payload.Value.State.Status(TaskStatusColumn.Statues.Executing);
|
||||
|
@ -6,26 +6,26 @@ namespace Dot.Git;
|
||||
internal sealed class Option : OptionBase
|
||||
{
|
||||
[CommandOption("-a|--args")]
|
||||
[Description(nameof(Str.GitArgs))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.GitArgs))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue("status")]
|
||||
public string Args { get; set; }
|
||||
|
||||
[CommandOption("-e|--git-output-encoding")]
|
||||
[Description(nameof(Str.GitOutputEncoding))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.GitOutputEncoding))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue("utf-8")]
|
||||
public string GitOutputEncoding { get; set; }
|
||||
|
||||
[CommandOption("-d|--max-recursion-depth")]
|
||||
[Description(nameof(Str.MaxRecursionDepth))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.MaxRecursionDepth))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(int.MaxValue)]
|
||||
public int MaxRecursionDepth { get; set; }
|
||||
|
||||
[CommandArgument(0, "[path]")]
|
||||
[Description(nameof(Str.FolderPath))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.FolderPath))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(".")]
|
||||
public string Path { get; set; }
|
||||
}
|
@ -10,18 +10,34 @@ internal sealed class TaskStatusColumn : ProgressColumn
|
||||
{
|
||||
public enum Statues : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// Ready
|
||||
/// </summary>
|
||||
[Description($"[gray]{nameof(Ready)}[/]")]
|
||||
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
Ready
|
||||
|
||||
, [Description($"[yellow]{nameof(Executing)}[/]")]
|
||||
,
|
||||
|
||||
/// <summary>
|
||||
/// Executing
|
||||
/// </summary>
|
||||
[Description($"[yellow]{nameof(Executing)}[/]")]
|
||||
Executing
|
||||
|
||||
, [Description($"[green]{nameof(Succeed)}[/]")]
|
||||
,
|
||||
|
||||
/// <summary>
|
||||
/// Succeed
|
||||
/// </summary>
|
||||
[Description($"[green]{nameof(Succeed)}[/]")]
|
||||
Succeed
|
||||
|
||||
, [Description($"[red]{nameof(Failed)}[/]")]
|
||||
,
|
||||
|
||||
/// <summary>
|
||||
/// Failed
|
||||
/// </summary>
|
||||
[Description($"[red]{nameof(Failed)}[/]")]
|
||||
Failed
|
||||
}
|
||||
|
||||
|
@ -6,8 +6,8 @@ using TextCopy;
|
||||
|
||||
namespace Dot.Guid;
|
||||
|
||||
[Description(nameof(Str.GuidTool))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.GuidTool))]
|
||||
[Localization(typeof(Ln))]
|
||||
internal sealed class Main : ToolBase<Option>
|
||||
{
|
||||
protected override Task Core()
|
||||
@ -17,7 +17,7 @@ internal sealed class Main : ToolBase<Option>
|
||||
guid = guid.ToUpper(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
Console.WriteLine(Str.Copied, guid);
|
||||
Console.WriteLine(Ln.Copied, guid);
|
||||
#if NET7_0_WINDOWS
|
||||
ClipboardService.SetText(guid);
|
||||
#endif
|
||||
|
@ -6,8 +6,8 @@ namespace Dot.Guid;
|
||||
internal sealed class Option : OptionBase
|
||||
{
|
||||
[CommandOption("-u|--upper")]
|
||||
[Description(nameof(Str.UseUppercase))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.UseUppercase))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(false)]
|
||||
public bool Upper { get; set; }
|
||||
}
|
@ -5,8 +5,8 @@ using System.Net.Sockets;
|
||||
|
||||
namespace Dot.IP;
|
||||
|
||||
[Description(nameof(Str.Ip))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.Ip))]
|
||||
[Localization(typeof(Ln))]
|
||||
internal sealed class Main : ToolBase<Option>
|
||||
{
|
||||
protected override async Task Core()
|
||||
@ -26,7 +26,7 @@ internal sealed class Main : ToolBase<Option>
|
||||
}
|
||||
|
||||
using var http = new HttpClient();
|
||||
Console.Write(Str.PublicIP);
|
||||
Console.Write(Ln.PublicIP);
|
||||
var str = await http.GetStringAsync("http://httpbin.org/ip");
|
||||
Console.WriteLine(str);
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ using TextCopy;
|
||||
|
||||
namespace Dot.Json;
|
||||
|
||||
[Description(nameof(Str.Json))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.Json))]
|
||||
[Localization(typeof(Ln))]
|
||||
internal sealed class Main : ToolBase<Option>
|
||||
{
|
||||
private object _inputObj;
|
||||
@ -24,7 +24,7 @@ internal sealed class Main : ToolBase<Option>
|
||||
}
|
||||
#endif
|
||||
if (inputText.NullOrWhiteSpace()) {
|
||||
throw new ArgumentException(Str.InputTextIsEmpty);
|
||||
throw new ArgumentException(Ln.InputTextIsEmpty);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -40,7 +40,7 @@ internal sealed class Main : ToolBase<Option>
|
||||
// ignored
|
||||
}
|
||||
|
||||
throw new ArgumentException(Str.InvalidJsonString);
|
||||
throw new ArgumentException(Ln.InvalidJsonString);
|
||||
}
|
||||
|
||||
return CoreInternal();
|
||||
|
@ -6,25 +6,25 @@ namespace Dot.Json;
|
||||
internal sealed class Option : OptionBase
|
||||
{
|
||||
[CommandOption("-c|--compress")]
|
||||
[Description(nameof(Str.CompressJson))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.CompressJson))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(false)]
|
||||
public bool Compress { get; set; }
|
||||
|
||||
[CommandOption("-s|--convert-to-string")]
|
||||
[Description(nameof(Str.JsonToString))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.JsonToString))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(false)]
|
||||
public bool ConvertToString { get; set; }
|
||||
|
||||
[CommandOption("-f|--format")]
|
||||
[Description(nameof(Str.FormatJson))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.FormatJson))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(true)]
|
||||
public bool Format { get; set; }
|
||||
|
||||
[CommandArgument(0, "[input text]")]
|
||||
[Description(nameof(Str.TextTobeProcessed))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.TextTobeProcessed))]
|
||||
[Localization(typeof(Ln))]
|
||||
public string InputText { get; set; }
|
||||
}
|
@ -1,11 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<root>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
|
||||
id="root"
|
||||
xmlns="">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
@ -63,7 +61,6 @@
|
||||
<data name="TextTobeProcessed" xml:space="preserve">
|
||||
<value>要处理的文本(默认取取剪贴板值)</value>
|
||||
</data>
|
||||
|
||||
<data name="Copied" xml:space="preserve">
|
||||
<value>{0}(已复制到剪贴板)</value>
|
||||
</data>
|
||||
@ -130,15 +127,12 @@
|
||||
<data name="RandomPasswordGenerator" xml:space="preserve">
|
||||
<value>随机密码生成器</value>
|
||||
</data>
|
||||
|
||||
<data name="PwdLength" xml:space="preserve">
|
||||
<value>密码长度</value>
|
||||
</data>
|
||||
|
||||
<data name="PwdGenerateTypes" xml:space="preserve">
|
||||
<value>BitSet 1:[0-9],2:[a-z],4:[A-Z],8:[ascii.0x21-0x2F]</value>
|
||||
</data>
|
||||
|
||||
<data name="RemoveTrailingWhiteSpaces" xml:space="preserve">
|
||||
<value>移除文件尾部换行和空格</value>
|
||||
</data>
|
||||
@ -205,11 +199,9 @@
|
||||
<data name="Read" xml:space="preserve">
|
||||
<value>读取</value>
|
||||
</data>
|
||||
|
||||
<data name="Write" xml:space="preserve">
|
||||
<value>写入</value>
|
||||
</data>
|
||||
|
||||
<data name="Break" xml:space="preserve">
|
||||
<value>跳过</value>
|
||||
</data>
|
@ -27,14 +27,14 @@ namespace Dot.Lang {
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal sealed class Str {
|
||||
internal sealed class Ln {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Str() {
|
||||
internal Ln() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -44,7 +44,7 @@ namespace Dot.Lang {
|
||||
public static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Dot.Lang.Str", typeof(Str).Assembly);
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Dot.Languages.Ln", typeof(Ln).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
@ -67,7 +67,7 @@ namespace Dot.Lang {
|
||||
|
||||
<#
|
||||
var xml = new XmlDocument();
|
||||
xml.Load("Str.resx");
|
||||
xml.Load("Ln.resx");
|
||||
foreach (XmlNode data in xml.SelectNodes("//root/data")!)
|
||||
{
|
||||
#>
|
@ -67,8 +67,11 @@ internal sealed class MouseHook : IDisposable
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
private readonly struct Msllhookstruct
|
||||
{
|
||||
[FieldOffset(0)] public readonly int X;
|
||||
[FieldOffset(4)] public readonly int Y;
|
||||
[FieldOffset(0)]
|
||||
public readonly int X;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public readonly int Y;
|
||||
}
|
||||
}
|
||||
#endif
|
@ -87,41 +87,79 @@ internal static partial class Win32
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public readonly struct KbdllhooksStruct
|
||||
{
|
||||
[FieldOffset(0)] public readonly uint vkCode;
|
||||
[FieldOffset(16)] private readonly nint dwExtraInfo;
|
||||
[FieldOffset(8)] private readonly uint flags;
|
||||
[FieldOffset(4)] private readonly uint scanCode;
|
||||
[FieldOffset(12)] private readonly uint time;
|
||||
[FieldOffset(0)]
|
||||
public readonly uint vkCode;
|
||||
|
||||
[FieldOffset(16)]
|
||||
private readonly nint dwExtraInfo;
|
||||
|
||||
[FieldOffset(8)]
|
||||
private readonly uint flags;
|
||||
|
||||
[FieldOffset(4)]
|
||||
private readonly uint scanCode;
|
||||
|
||||
[FieldOffset(12)]
|
||||
private readonly uint time;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public struct InputStruct
|
||||
{
|
||||
[FieldOffset(8)] public KeybdInputStruct ki;
|
||||
[FieldOffset(0)] public uint type;
|
||||
[FieldOffset(8)]
|
||||
public KeybdInputStruct ki;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public uint type;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public struct KeybdInputStruct
|
||||
{
|
||||
[FieldOffset(4)] public uint dwFlags;
|
||||
[FieldOffset(0)] public ushort wVk;
|
||||
[FieldOffset(20)] private readonly long _; // 补位以匹配 UNION的MOUSEINPUT参数 (28bytes)
|
||||
[FieldOffset(12)] private readonly nint dwExtraInfo;
|
||||
[FieldOffset(8)] private readonly uint time;
|
||||
[FieldOffset(2)] private readonly ushort wScan;
|
||||
[FieldOffset(4)]
|
||||
public uint dwFlags;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public ushort wVk;
|
||||
|
||||
[FieldOffset(20)]
|
||||
private readonly long _; // 补位以匹配 UNION的MOUSEINPUT参数 (28bytes)
|
||||
|
||||
[FieldOffset(12)]
|
||||
private readonly nint dwExtraInfo;
|
||||
|
||||
[FieldOffset(8)]
|
||||
private readonly uint time;
|
||||
|
||||
[FieldOffset(2)]
|
||||
private readonly ushort wScan;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public ref struct Systemtime
|
||||
{
|
||||
[FieldOffset(6)] public ushort wDay;
|
||||
[FieldOffset(4)] public ushort wDayOfWeek;
|
||||
[FieldOffset(8)] public ushort wHour;
|
||||
[FieldOffset(14)] public ushort wMilliseconds;
|
||||
[FieldOffset(10)] public ushort wMinute;
|
||||
[FieldOffset(2)] public ushort wMonth;
|
||||
[FieldOffset(12)] public ushort wSecond;
|
||||
[FieldOffset(0)] public ushort wYear;
|
||||
[FieldOffset(6)]
|
||||
public ushort wDay;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public ushort wDayOfWeek;
|
||||
|
||||
[FieldOffset(8)]
|
||||
public ushort wHour;
|
||||
|
||||
[FieldOffset(14)]
|
||||
public ushort wMilliseconds;
|
||||
|
||||
[FieldOffset(10)]
|
||||
public ushort wMinute;
|
||||
|
||||
[FieldOffset(2)]
|
||||
public ushort wMonth;
|
||||
|
||||
[FieldOffset(12)]
|
||||
public ushort wSecond;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public ushort wYear;
|
||||
}
|
||||
}
|
@ -8,8 +8,8 @@ namespace Dot;
|
||||
internal abstract class OptionBase : CommandSettings, IOption
|
||||
{
|
||||
[CommandOption("-k|--keep--session")]
|
||||
[Description(nameof(Str.KeepSession))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.KeepSession))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(false)]
|
||||
public bool KeepSession { get; set; }
|
||||
}
|
@ -7,8 +7,8 @@ using TextCopy;
|
||||
|
||||
namespace Dot.Pwd;
|
||||
|
||||
[Description(nameof(Str.RandomPasswordGenerator))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.RandomPasswordGenerator))]
|
||||
[Localization(typeof(Ln))]
|
||||
internal sealed class Main : ToolBase<Option>
|
||||
{
|
||||
private readonly char[][] _charTable = {
|
||||
@ -55,7 +55,7 @@ internal sealed class Main : ToolBase<Option>
|
||||
}
|
||||
|
||||
var result = new string(pDest, 0, Opt.Length);
|
||||
Console.WriteLine(Str.Copied, result);
|
||||
Console.WriteLine(Ln.Copied, result);
|
||||
#if NET7_0_WINDOWS
|
||||
ClipboardService.SetText(result);
|
||||
#endif
|
||||
|
@ -15,12 +15,12 @@ internal sealed class Option : OptionBase
|
||||
}
|
||||
|
||||
[CommandArgument(1, "<password length>")]
|
||||
[Description(nameof(Str.PwdLength))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.PwdLength))]
|
||||
[Localization(typeof(Ln))]
|
||||
public int Length { get; set; }
|
||||
|
||||
[CommandArgument(0, "<generate type>")]
|
||||
[Description(nameof(Str.PwdGenerateTypes))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.PwdGenerateTypes))]
|
||||
[Localization(typeof(Ln))]
|
||||
public GenerateTypes Type { get; set; }
|
||||
}
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace Dot.Rbom;
|
||||
|
||||
[Description(nameof(Str.TrimUtf8Bom))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.TrimUtf8Bom))]
|
||||
[Localization(typeof(Ln))]
|
||||
internal sealed class Main : FilesTool<Option>
|
||||
{
|
||||
private readonly byte[] _utf8Bom = { 0xef, 0xbb, 0xbf };
|
||||
|
@ -10,8 +10,8 @@ using TextCopy;
|
||||
|
||||
namespace Dot.Text;
|
||||
|
||||
[Description(nameof(Str.TextTool))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.TextTool))]
|
||||
[Localization(typeof(Ln))]
|
||||
internal sealed class Main : ToolBase<Option>
|
||||
{
|
||||
#if NET7_0_WINDOWS
|
||||
@ -26,7 +26,7 @@ internal sealed class Main : ToolBase<Option>
|
||||
}
|
||||
#endif
|
||||
if (Opt.Text.NullOrEmpty()) {
|
||||
throw new ArgumentException(Str.InputTextIsEmpty);
|
||||
throw new ArgumentException(Ln.InputTextIsEmpty);
|
||||
}
|
||||
|
||||
ParseAndShow(Opt.Text);
|
||||
|
@ -5,7 +5,7 @@ namespace Dot.Text;
|
||||
internal sealed class Option : OptionBase
|
||||
{
|
||||
[CommandArgument(0, "[input text]")]
|
||||
[Description(nameof(Str.TextTobeProcessed))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.TextTobeProcessed))]
|
||||
[Localization(typeof(Ln))]
|
||||
public string Text { get; set; }
|
||||
}
|
@ -5,8 +5,8 @@ using Dot.Native;
|
||||
|
||||
namespace Dot.Time;
|
||||
|
||||
[Description(nameof(Str.TimeTool))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.TimeTool))]
|
||||
[Localization(typeof(Ln))]
|
||||
internal sealed class Main : ToolBase<Option>
|
||||
{
|
||||
private const int _MAX_DEGREE_OF_PARALLELISM = 10;
|
||||
@ -56,12 +56,12 @@ internal sealed class Main : ToolBase<Option>
|
||||
.Average(x => x.Value.State.Result().TotalMilliseconds);
|
||||
});
|
||||
|
||||
AnsiConsole.MarkupLine(CultureInfo.InvariantCulture, Str.NtpReceiveDone, $"[green]{_successCnt}[/]"
|
||||
AnsiConsole.MarkupLine(CultureInfo.InvariantCulture, Ln.NtpReceiveDone, $"[green]{_successCnt}[/]"
|
||||
, _ntpServers.Length, $"[yellow]{_offsetAvg:f2}[/]");
|
||||
|
||||
if (Opt.Sync) {
|
||||
SetSysteTime(DateTime.Now.AddMilliseconds(-_offsetAvg));
|
||||
AnsiConsole.MarkupLine($"[green]{Str.LocalTimeSyncDone}[/]");
|
||||
AnsiConsole.MarkupLine($"[green]{Ln.LocalTimeSyncDone}[/]");
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,9 +72,9 @@ internal sealed class Main : ToolBase<Option>
|
||||
var table = new Table().HideHeaders()
|
||||
.AddColumn(new TableColumn(string.Empty))
|
||||
.AddColumn(new TableColumn(string.Empty))
|
||||
.Caption(Str.PressAnyKey)
|
||||
.AddRow(Str.NtpClock, DateTime.Now.AddMilliseconds(-_offsetAvg).ToString("O"))
|
||||
.AddRow(Str.LocalClock, DateTime.Now.ToString("O"));
|
||||
.Caption(Ln.PressAnyKey)
|
||||
.AddRow(Ln.NtpClock, DateTime.Now.AddMilliseconds(-_offsetAvg).ToString("O"))
|
||||
.AddRow(Ln.LocalClock, DateTime.Now.ToString("O"));
|
||||
|
||||
var cts = new CancellationTokenSource();
|
||||
var task = AnsiConsole.Live(table)
|
||||
@ -145,7 +145,9 @@ internal sealed class Main : ToolBase<Option>
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning disable SA1313
|
||||
private ValueTask ServerHandle(KeyValuePair<string, ProgressTask> payload, CancellationToken _)
|
||||
#pragma warning restore SA1313
|
||||
{
|
||||
payload.Value.StartTask();
|
||||
payload.Value.State.Status(TaskStatusColumn.Statues.Connecting);
|
||||
|
@ -6,14 +6,14 @@ namespace Dot.Time;
|
||||
internal sealed class Option : OptionBase
|
||||
{
|
||||
[CommandOption("-s|--sync")]
|
||||
[Description(nameof(Str.SyncToLocalTime))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.SyncToLocalTime))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(false)]
|
||||
public bool Sync { get; set; }
|
||||
|
||||
[CommandOption("-t|--timeout")]
|
||||
[Description(nameof(Str.TimeoutMillSecs))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.TimeoutMillSecs))]
|
||||
[Localization(typeof(Ln))]
|
||||
[DefaultValue(2000)]
|
||||
public int Timeout { get; set; }
|
||||
}
|
@ -10,17 +10,34 @@ internal sealed class TaskStatusColumn : ProgressColumn
|
||||
{
|
||||
public enum Statues : byte
|
||||
{
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
/// <summary>
|
||||
/// Ready
|
||||
/// </summary>
|
||||
[Description($"[gray]{nameof(Ready)}[/]")]
|
||||
Ready
|
||||
|
||||
, [Description($"[yellow]{nameof(Connecting)}[/]")]
|
||||
,
|
||||
|
||||
/// <summary>
|
||||
/// Connecting
|
||||
/// </summary>
|
||||
[Description($"[yellow]{nameof(Connecting)}[/]")]
|
||||
Connecting
|
||||
|
||||
, [Description($"[green]{nameof(Succeed)}[/]")]
|
||||
,
|
||||
|
||||
/// <summary>
|
||||
/// Succeed
|
||||
/// </summary>
|
||||
[Description($"[green]{nameof(Succeed)}[/]")]
|
||||
Succeed
|
||||
|
||||
, [Description($"[red]{nameof(Failed)}[/]")]
|
||||
,
|
||||
|
||||
/// <summary>
|
||||
/// Failed
|
||||
/// </summary>
|
||||
[Description($"[red]{nameof(Failed)}[/]")]
|
||||
Failed
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace Dot.ToLf;
|
||||
|
||||
[Description(nameof(Str.ConvertEndOfLineToLF))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.ConvertEndOfLineToLF))]
|
||||
[Localization(typeof(Ln))]
|
||||
internal sealed class Main : FilesTool<Option>
|
||||
{
|
||||
protected override async ValueTask FileHandle(string file, CancellationToken cancelToken)
|
||||
@ -31,12 +31,12 @@ internal sealed class Main : FilesTool<Option>
|
||||
fsw.WriteByte(0x0a);
|
||||
hasWrote = true;
|
||||
continue;
|
||||
case 0x0d: //cr macos
|
||||
case 0x0d: // cr macos
|
||||
fsw.WriteByte(0x0a);
|
||||
_ = fsr.Seek(-1, SeekOrigin.Current);
|
||||
hasWrote = true;
|
||||
continue;
|
||||
case 0x00 or 0xff: //非文本文件
|
||||
case 0x00 or 0xff: // 非文本文件
|
||||
isBin = true;
|
||||
break;
|
||||
default:
|
||||
|
@ -18,7 +18,7 @@ internal abstract class ToolBase<TOption> : Command<TOption>
|
||||
{
|
||||
await Core();
|
||||
if (Opt.KeepSession) {
|
||||
AnsiConsole.MarkupLine(Str.PressAnyKey);
|
||||
AnsiConsole.MarkupLine(Ln.PressAnyKey);
|
||||
_ = AnsiConsole.Console.Input.ReadKey(true);
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ using NSExt.Extensions;
|
||||
|
||||
namespace Dot.Tran;
|
||||
|
||||
[Description(nameof(Str.TranslateTool))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.TranslateTool))]
|
||||
[Localization(typeof(Ln))]
|
||||
|
||||
// ReSharper disable once ClassNeverInstantiated.Global
|
||||
internal sealed class Main : ToolBase<Option>
|
||||
@ -14,8 +14,8 @@ internal sealed class Main : ToolBase<Option>
|
||||
[SupportedOSPlatform(nameof(OSPlatform.Windows))]
|
||||
protected override Task Core()
|
||||
{
|
||||
AnsiConsole.MarkupLine(Str.StartTranslate);
|
||||
AnsiConsole.MarkupLine(Str.HideTranslate);
|
||||
AnsiConsole.MarkupLine(Ln.StartTranslate);
|
||||
AnsiConsole.MarkupLine(Ln.HideTranslate);
|
||||
var th = new Thread(() => {
|
||||
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
|
||||
AppDomain.CurrentDomain.UnhandledException += UnhandledException;
|
||||
|
@ -190,7 +190,7 @@ internal sealed partial class WinMain : Form
|
||||
return;
|
||||
}
|
||||
|
||||
_labelDest.Text = Str.Translating;
|
||||
_labelDest.Text = Ln.Translating;
|
||||
Task.Run(() => {
|
||||
var translateText = TranslateText(clipText);
|
||||
ClipboardService.SetText(translateText);
|
||||
@ -228,7 +228,7 @@ internal sealed partial class WinMain : Form
|
||||
Console.Error.WriteLine(rspObj.Json().UnicodeDe());
|
||||
Console.Error.WriteLine(rsp.Headers.Json());
|
||||
|
||||
//cookie or token invalid
|
||||
// cookie or token invalid
|
||||
Task.Delay(_RETRY_WAIT_MIL_SEC).Wait();
|
||||
UpdateStateFile();
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ using NSExt.Extensions;
|
||||
|
||||
namespace Dot.Trim;
|
||||
|
||||
[Description(nameof(Str.RemoveTrailingWhiteSpaces))]
|
||||
[Localization(typeof(Str))]
|
||||
[Description(nameof(Ln.RemoveTrailingWhiteSpaces))]
|
||||
[Localization(typeof(Ln))]
|
||||
internal sealed class Main : FilesTool<Option>
|
||||
{
|
||||
protected override async ValueTask FileHandle(string file, CancellationToken cancelToken)
|
||||
|
@ -2,14 +2,8 @@
|
||||
<PropertyGroup>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<AssemblyTitle>功能全面的实用工具 - 程序员的瑞士军刀</AssemblyTitle>
|
||||
<Copyright>Copyright (c) 2022 nsnail</Copyright>
|
||||
<EnableWindowsTargeting>true</EnableWindowsTargeting>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<OutputType>Exe</OutputType>
|
||||
<Product>dot</Product>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/nsnail/dot.git</RepositoryUrl>
|
||||
<RootNamespace>Dot</RootNamespace>
|
||||
<TargetFrameworks>net7.0-windows;net7.0</TargetFrameworks>
|
||||
<UseWindowsForms Condition="'$(TargetFramework)' == 'net7.0-windows'">true</UseWindowsForms>
|
||||
</PropertyGroup>
|
||||
@ -17,21 +11,17 @@
|
||||
<DefineConstants>$(DefineConstants);NET7_0_WINDOWS</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NSExt" Version="1.0.11-alpha.0.1"/>
|
||||
<PackageReference Include="Spectre.Console.Cli.NS" Version="0.45.1-preview.0.48"/>
|
||||
<PackageReference Include="Spectre.Console.NS" Version="0.45.1-preview.0.48"/>
|
||||
<PackageReference Condition="'$(TargetFramework)' == 'net7.0-windows'" Include="TextCopy" Version="6.2.1"/>
|
||||
<PackageReference Include="MinVer" Version="4.3.0-beta.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NSExt" Version="1.0.11-alpha.0.1" />
|
||||
<PackageReference Include="Spectre.Console.Cli.NS" Version="0.45.1-preview.0.48" />
|
||||
<PackageReference Include="Spectre.Console.NS" Version="0.45.1-preview.0.48" />
|
||||
<PackageReference Condition="'$(TargetFramework)' == 'net7.0-windows'" Include="TextCopy" Version="6.2.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Lang\Str.resx">
|
||||
<EmbeddedResource Update="Languages\Ln.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Str.Designer.cs</LastGenOutput>
|
||||
<LastGenOutput>Ln.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="../CodeQuality.props"/>
|
||||
<Import Project="../GenerateResx.targets"/>
|
||||
<Import Project="../CodeQuality.props" />
|
||||
<Import Project="../GenerateResx.targets" />
|
||||
</Project>
|
@ -1,2 +1,2 @@
|
||||
# https://github.com/RicoSuter/DNT#switch-to-projects
|
||||
@rem https://github.com/RicoSuter/DNT#switch-to-projects
|
||||
dnt switch-to-packages
|
@ -1,2 +1,2 @@
|
||||
# https://github.com/RicoSuter/DNT#switch-to-projects
|
||||
@rem https://github.com/RicoSuter/DNT#switch-to-projects
|
||||
dnt switch-to-projects
|
@ -1,24 +0,0 @@
|
||||
{
|
||||
"solution": "dot.sln",
|
||||
"solutionFolder": null,
|
||||
"mappings": {
|
||||
"NSExt": "../../../../ForkedGitReps/ns-ext/src/NSExt.csproj",
|
||||
"Spectre.Console.Cli": "../../../../ForkedGitReps/spectre.console/src/Spectre.Console.Cli/Spectre.Console.Cli.csproj"
|
||||
},
|
||||
"restore": [
|
||||
{
|
||||
"name": "dot",
|
||||
"packages": [
|
||||
{
|
||||
"packageName": "NSExt",
|
||||
"version": "1.0.11-alpha.0.1"
|
||||
},
|
||||
{
|
||||
"packageName": "Spectre.Console.Cli.NS",
|
||||
"version": "0.45.1-preview.0.48"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"removeProjects": true
|
||||
}
|
8
switcher.nsext.json
Normal file
8
switcher.nsext.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"solution": "NetAdmin.sln",
|
||||
"solutionFolder": null,
|
||||
"mappings": {
|
||||
"NSExt": "../../../../ForkedGitReps/ns-ext/src/NSExt.csproj"
|
||||
},
|
||||
"removeProjects": true
|
||||
}
|
@ -3,8 +3,14 @@ using System.Security.Cryptography;
|
||||
|
||||
namespace Dot.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// TestGet
|
||||
/// </summary>
|
||||
public class TestGet
|
||||
{
|
||||
/// <summary>
|
||||
/// DownloadFile
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void DownloadFile()
|
||||
{
|
||||
@ -27,9 +33,17 @@ public class TestGet
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setup
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Setup() { }
|
||||
|
||||
/// <summary>
|
||||
/// GetFileSha1
|
||||
/// </summary>
|
||||
/// <param name="file"></param>
|
||||
/// <returns></returns>
|
||||
private static string GetFileSha1(string file)
|
||||
{
|
||||
using var fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||
|
@ -5,9 +5,9 @@
|
||||
<RootNamespace>Dot.Tests</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0-preview-20221003-04"/>
|
||||
<PackageReference Include="NUnit" Version="3.13.3"/>
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1"/>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0-preview-20221003-04" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.5.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
@ -17,5 +17,4 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Loading…
x
Reference in New Issue
Block a user