Skip to content

Commit bb3c001

Browse files
Added ILRepack
1 parent ca9be17 commit bb3c001

File tree

16 files changed

+1221
-314
lines changed

16 files changed

+1221
-314
lines changed

TestConsole1/Program.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace TestConsole1
2+
{
3+
internal class Program
4+
{
5+
static void Main(string[] args)
6+
{
7+
Console.WriteLine("Hello, World!");
8+
}
9+
}
10+
}

TestConsole1/TestConsole1.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
</Project>

TranslateFileNames.sln

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27428.2005
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.3.32611.2
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TranslateFileNames", "TranslateFileNames\TranslateFileNames.csproj", "{C937155F-9C5B-4B1D-A8EF-C18AF3A799DB}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GTranslate", "GTranslate\src\GTranslate\GTranslate.csproj", "{291CB6C6-7CEC-4660-AA60-5FD2B81BCED5}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TranslateFilenames", "TranslateFilenames\TranslateFilenames.csproj", "{5A618590-74D1-4A58-88C1-3D9D343B0784}"
79
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Any CPU = Debug|Any CPU
1113
Release|Any CPU = Release|Any CPU
1214
EndGlobalSection
1315
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{C937155F-9C5B-4B1D-A8EF-C18AF3A799DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{C937155F-9C5B-4B1D-A8EF-C18AF3A799DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{C937155F-9C5B-4B1D-A8EF-C18AF3A799DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{C937155F-9C5B-4B1D-A8EF-C18AF3A799DB}.Release|Any CPU.Build.0 = Release|Any CPU
16+
{291CB6C6-7CEC-4660-AA60-5FD2B81BCED5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{291CB6C6-7CEC-4660-AA60-5FD2B81BCED5}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{291CB6C6-7CEC-4660-AA60-5FD2B81BCED5}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{291CB6C6-7CEC-4660-AA60-5FD2B81BCED5}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{5A618590-74D1-4A58-88C1-3D9D343B0784}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{5A618590-74D1-4A58-88C1-3D9D343B0784}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{5A618590-74D1-4A58-88C1-3D9D343B0784}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{5A618590-74D1-4A58-88C1-3D9D343B0784}.Release|Any CPU.Build.0 = Release|Any CPU
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE

TranslateFileNames/Program.cs

Lines changed: 83 additions & 72 deletions
Large diffs are not rendered by default.

TranslateFileNames/TranslateFileNames.csproj

Lines changed: 43 additions & 179 deletions
Large diffs are not rendered by default.

TranslateFileNames/packages.config

Lines changed: 0 additions & 32 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" />
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1"/>
55
</startup>
66
<runtime>
77
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
88
<dependentAssembly>
9-
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
10-
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
9+
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
10+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
1111
</dependentAssembly>
1212
<dependentAssembly>
13-
<assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
14-
<bindingRedirect oldVersion="0.0.0.0-1.57.0.0" newVersion="1.57.0.0" />
13+
<assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral"/>
14+
<bindingRedirect oldVersion="0.0.0.0-1.57.0.0" newVersion="1.57.0.0"/>
1515
</dependentAssembly>
1616
<dependentAssembly>
17-
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
18-
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
17+
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
18+
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
1919
</dependentAssembly>
2020
<dependentAssembly>
21-
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
22-
<bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1" />
21+
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral"/>
22+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1"/>
2323
</dependentAssembly>
2424
<dependentAssembly>
25-
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
26-
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
25+
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
26+
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2"/>
2727
</dependentAssembly>
2828
<dependentAssembly>
29-
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
30-
<bindingRedirect oldVersion="0.0.0.0-6.0.0.5" newVersion="6.0.0.5" />
29+
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
30+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.5" newVersion="6.0.0.5"/>
3131
</dependentAssembly>
3232
<dependentAssembly>
33-
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
34-
<bindingRedirect oldVersion="0.0.0.0-3.21.2.0" newVersion="3.21.2.0" />
33+
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral"/>
34+
<bindingRedirect oldVersion="0.0.0.0-3.21.2.0" newVersion="3.21.2.0"/>
3535
</dependentAssembly>
3636
<dependentAssembly>
37-
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
38-
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
37+
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
38+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
3939
</dependentAssembly>
4040
<dependentAssembly>
41-
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
42-
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
41+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
42+
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0"/>
4343
</dependentAssembly>
4444
</assemblyBinding>
4545
</runtime>
46-
</configuration>
46+
</configuration>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
using System;
2+
3+
public class ConsoleProgressBar
4+
{
5+
private const ConsoleColor ForeColor = ConsoleColor.Green;
6+
private const ConsoleColor BkColor = ConsoleColor.Gray;
7+
private const int DefaultWidthOfBar = 32;
8+
private const int TextMarginLeft = 3;
9+
10+
private readonly int _total;
11+
private readonly int _widthOfBar;
12+
private string _appendedText;
13+
private int _cursorTopPos = 0;
14+
15+
public ConsoleProgressBar(int total, string AppendedText = "", int widthOfBar = DefaultWidthOfBar)
16+
{
17+
_appendedText = AppendedText;
18+
_total = total;
19+
_widthOfBar = widthOfBar;
20+
}
21+
22+
private bool _intited;
23+
public void Init()
24+
{
25+
_lastPosition = 0;
26+
27+
_cursorTopPos = Console.CursorTop;
28+
//Draw empty progress bar
29+
Console.CursorVisible = false;
30+
Console.CursorLeft = 0;
31+
Console.Write("["); //start
32+
Console.CursorLeft = _widthOfBar;
33+
Console.Write("]"); //end
34+
Console.CursorLeft = 1;
35+
36+
//Draw background bar
37+
for (var position = 1; position < _widthOfBar; position++) //Skip the first position which is "[".
38+
{
39+
Console.BackgroundColor = BkColor;
40+
Console.CursorLeft = position;
41+
Console.Write(" ");
42+
}
43+
}
44+
45+
public void ShowProgress(int currentCount)
46+
{
47+
if (!_intited)
48+
{
49+
Init();
50+
_intited = true;
51+
}
52+
DrawTextProgressBar(currentCount);
53+
}
54+
55+
private int _lastPosition = 0;
56+
57+
public void DrawTextProgressBar(int currentCount)
58+
{
59+
Console.CursorTop = _cursorTopPos;
60+
//Draw current chunk.
61+
var position = currentCount * _widthOfBar / _total;
62+
if (position != _lastPosition)
63+
{
64+
_lastPosition = position;
65+
Console.BackgroundColor = ForeColor;
66+
Console.CursorLeft = position >= _widthOfBar ? _widthOfBar - 1 : position;
67+
Console.Write(" ");
68+
}
69+
70+
//Draw totals
71+
Console.CursorLeft = _widthOfBar + TextMarginLeft;
72+
Console.BackgroundColor = ConsoleColor.Black;
73+
double Perc = (double)currentCount / (double)_total;
74+
Console.Write(currentCount + " of " + _total + " (" + Perc.ToString("P2") + ") " + _appendedText + " "); //blanks at the end remove any excess
75+
}
76+
}
77+

0 commit comments

Comments
 (0)