Skip to content

Commit

Permalink
add standalone configuration tool
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhngtu committed Aug 14, 2022
1 parent ac431b1 commit ccd100f
Show file tree
Hide file tree
Showing 18 changed files with 923 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ TestRelease/
VietTypeATL/VersionVCS.h
VietTypeATL/VersionNumbers.h
VietTypeSetup/Version.wxi
VietTypeConfig/Properties/Version.cs
VietTypeBundle/*.exe
16 changes: 16 additions & 0 deletions UpdateVersionCs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
param([switch] $Force)

Get-Content -Raw "$PSScriptRoot\Version.ps1" | Invoke-Expression

$csFile = "..\..\Properties\Version.cs"
$csOld = Get-Content -ErrorAction Ignore -Raw $csFile
$csNew = `
@"
using System.Reflection;
[assembly: AssemblyInformationalVersion("$($productVersion[0]).$($productVersion[1]).$($productVersion[2]).$($productVersion[3])")]
"@
if ($Force -or ($csOld -ne $csNew)) {
echo "Updating Version.cs"
[System.IO.File]::WriteAllText($csFile, [string]::Join("`n", $csNew))
}
18 changes: 16 additions & 2 deletions VietType.sln
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29102.190
# Visual Studio Version 17
VisualStudioVersion = 17.3.32804.467
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VietTypeTests", "VietTypeTests\VietTypeTests.vcxproj", "{78E8E578-91CC-468F-95DF-8BDE6A4CF76D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VietTypeATL", "VietTypeATL\VietTypeATL.vcxproj", "{6CA483BD-B365-42DC-8AE6-7CFBD2014CBE}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "VietTypeSetup", "VietTypeSetup\VietTypeSetup.wixproj", "{8882E9D2-7670-4906-98F5-60A147BF5ECA}"
ProjectSection(ProjectDependencies) = postProject
{E48868BF-C55D-41E4-9A25-85190BD57684} = {E48868BF-C55D-41E4-9A25-85190BD57684}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VietTypeUnitTests", "VietTypeUnitTests\VietTypeUnitTests.vcxproj", "{3F698192-164B-4E9D-91FD-DDD623C1C98C}"
EndProject
Expand All @@ -20,12 +23,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
LICENSE = LICENSE
LICENSE.rtf = LICENSE.rtf
UpdateVersion.ps1 = UpdateVersion.ps1
UpdateVersionCs.ps1 = UpdateVersionCs.ps1
UpdateVersionWix.ps1 = UpdateVersionWix.ps1
Version.ps1 = Version.ps1
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Telex", "Telex\Telex.vcxproj", "{4C4CE742-99A9-40E7-B03A-68A3CBE0AE77}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VietTypeConfig", "VietTypeConfig\VietTypeConfig.csproj", "{E48868BF-C55D-41E4-9A25-85190BD57684}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand Down Expand Up @@ -72,6 +78,14 @@ Global
{4C4CE742-99A9-40E7-B03A-68A3CBE0AE77}.Release|Win32.Build.0 = Release|Win32
{4C4CE742-99A9-40E7-B03A-68A3CBE0AE77}.Release|x64.ActiveCfg = Release|x64
{4C4CE742-99A9-40E7-B03A-68A3CBE0AE77}.Release|x64.Build.0 = Release|x64
{E48868BF-C55D-41E4-9A25-85190BD57684}.Debug|Win32.ActiveCfg = Debug|Any CPU
{E48868BF-C55D-41E4-9A25-85190BD57684}.Debug|Win32.Build.0 = Debug|Any CPU
{E48868BF-C55D-41E4-9A25-85190BD57684}.Debug|x64.ActiveCfg = Debug|Any CPU
{E48868BF-C55D-41E4-9A25-85190BD57684}.Debug|x64.Build.0 = Debug|Any CPU
{E48868BF-C55D-41E4-9A25-85190BD57684}.Release|Win32.ActiveCfg = Release|Any CPU
{E48868BF-C55D-41E4-9A25-85190BD57684}.Release|Win32.Build.0 = Release|Any CPU
{E48868BF-C55D-41E4-9A25-85190BD57684}.Release|x64.ActiveCfg = Release|Any CPU
{E48868BF-C55D-41E4-9A25-85190BD57684}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
9 changes: 9 additions & 0 deletions VietTypeConfig/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<System.Windows.Forms.ApplicationConfigurationSection>
<add key="DpiAwareness" value="PerMonitorV2" />
</System.Windows.Forms.ApplicationConfigurationSection>
</configuration>
158 changes: 158 additions & 0 deletions VietTypeConfig/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions VietTypeConfig/Form1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace VietTypeConfig {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e) {
settingsBindingSource.DataSource = Settings.LoadSettings();
}

private void CloseForm(object sender, EventArgs e) {
Close();
}

private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
var settings = settingsBindingSource.DataSource as Settings;
if (DialogResult == DialogResult.OK && settings != null) {
Settings.SaveSettings(settings);
}
}
}
}
Loading

0 comments on commit ccd100f

Please sign in to comment.