From 87b67a3d4df3df4e10b94518f6a39e06de2b5ab7 Mon Sep 17 00:00:00 2001 From: lahm86 <33758420+lahm86@users.noreply.github.com> Date: Thu, 5 Sep 2024 15:11:17 +0100 Subject: [PATCH] config_tool: make common config tool library (#24) --- tools/config/.gitignore | 15 + tools/config/TRX_ConfigToolLib.sln | 25 ++ .../Controls/AboutWindow.xaml | 69 ++++ .../Controls/AboutWindow.xaml.cs | 20 ++ .../Controls/CategoryControl.xaml | 44 +++ .../Controls/CategoryControl.xaml.cs | 17 + .../Controls/NumericUpDown.xaml | 91 +++++ .../Controls/NumericUpDown.xaml.cs | 240 +++++++++++++ .../Controls/PropertyControl.xaml | 56 +++ .../Controls/PropertyControl.xaml.cs | 11 + .../Controls/TRXConfigWindow.xaml | 221 ++++++++++++ .../Controls/TRXConfigWindow.xaml.cs | 47 +++ .../Models/AboutWindowViewModel.cs | 11 + .../Models/BaseLanguageViewModel.cs | 9 + .../Models/CategoryViewModel.cs | 32 ++ .../TRX_ConfigToolLib/Models/Lang/Language.cs | 49 +++ .../Models/Lang/PropertyText.cs | 7 + .../Models/MainWindowViewModel.cs | 334 ++++++++++++++++++ .../Models/Specification/BaseProperty.cs | 26 ++ .../Models/Specification/Category.cs | 12 + .../Models/Specification/Configuration.cs | 150 ++++++++ .../Models/Specification/DataType.cs | 8 + .../Models/Specification/EnumOption.cs | 11 + .../Models/Specification/Specification.cs | 42 +++ .../Specification/Types/BoolProperty.cs | 44 +++ .../Specification/Types/EnumProperty.cs | 54 +++ .../Specification/Types/NumericProperty.cs | 54 +++ .../TRX_ConfigToolLib/Models/TRXConstants.cs | 23 ++ .../TRX_ConfigToolLib/Resources/Lang/en.json | 37 ++ .../TRX_ConfigToolLib/Resources/Lang/es.json | 37 ++ .../TRX_ConfigToolLib/Resources/Lang/fr.json | 37 ++ .../TRX_ConfigToolLib/Resources/Lang/it.json | 37 ++ .../Resources/arrow-down.png | Bin 0 -> 373 bytes .../TRX_ConfigToolLib/Resources/arrow-up.png | Bin 0 -> 363 bytes .../TRX_ConfigToolLib/Resources/const.json | 4 + .../TRX_ConfigToolLib/Resources/styles.xaml | 189 ++++++++++ .../TRX_ConfigToolLib.csproj | 35 ++ .../TRX_ConfigToolLib/Utils/AssemblyUtils.cs | 35 ++ .../Utils/BaseNotifyPropertyChanged.cs | 14 + .../TRX_ConfigToolLib/Utils/BindingProxy.cs | 22 ++ .../Converters/BoolToVisibilityConverter.cs | 28 ++ .../Converters/ConditionalMarkupConverter.cs | 26 ++ .../ConditionalViewTextConverter.cs | 12 + .../Utils/Json/NumericConverter.cs | 17 + .../Utils/Json/PropertyConverter.cs | 41 +++ .../Utils/Json/PropertyResolver.cs | 15 + .../TRX_ConfigToolLib/Utils/JsonUtils.cs | 31 ++ .../Utils/MessageBoxUtils.cs | 21 ++ .../Utils/NumericValidationRule.cs | 72 ++++ .../TRX_ConfigToolLib/Utils/ProcessUtils.cs | 20 ++ .../TRX_ConfigToolLib/Utils/RelayCommand.cs | 125 +++++++ .../TRX_ConfigToolLib/Utils/VisualUtils.cs | 28 ++ 52 files changed, 2605 insertions(+) create mode 100644 tools/config/.gitignore create mode 100644 tools/config/TRX_ConfigToolLib.sln create mode 100644 tools/config/TRX_ConfigToolLib/Controls/AboutWindow.xaml create mode 100644 tools/config/TRX_ConfigToolLib/Controls/AboutWindow.xaml.cs create mode 100644 tools/config/TRX_ConfigToolLib/Controls/CategoryControl.xaml create mode 100644 tools/config/TRX_ConfigToolLib/Controls/CategoryControl.xaml.cs create mode 100644 tools/config/TRX_ConfigToolLib/Controls/NumericUpDown.xaml create mode 100644 tools/config/TRX_ConfigToolLib/Controls/NumericUpDown.xaml.cs create mode 100644 tools/config/TRX_ConfigToolLib/Controls/PropertyControl.xaml create mode 100644 tools/config/TRX_ConfigToolLib/Controls/PropertyControl.xaml.cs create mode 100644 tools/config/TRX_ConfigToolLib/Controls/TRXConfigWindow.xaml create mode 100644 tools/config/TRX_ConfigToolLib/Controls/TRXConfigWindow.xaml.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/AboutWindowViewModel.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/BaseLanguageViewModel.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/CategoryViewModel.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/Lang/Language.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/Lang/PropertyText.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/MainWindowViewModel.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/Specification/BaseProperty.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/Specification/Category.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/Specification/Configuration.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/Specification/DataType.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/Specification/EnumOption.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/Specification/Specification.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/Specification/Types/BoolProperty.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/Specification/Types/EnumProperty.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/Specification/Types/NumericProperty.cs create mode 100644 tools/config/TRX_ConfigToolLib/Models/TRXConstants.cs create mode 100644 tools/config/TRX_ConfigToolLib/Resources/Lang/en.json create mode 100644 tools/config/TRX_ConfigToolLib/Resources/Lang/es.json create mode 100644 tools/config/TRX_ConfigToolLib/Resources/Lang/fr.json create mode 100644 tools/config/TRX_ConfigToolLib/Resources/Lang/it.json create mode 100644 tools/config/TRX_ConfigToolLib/Resources/arrow-down.png create mode 100644 tools/config/TRX_ConfigToolLib/Resources/arrow-up.png create mode 100644 tools/config/TRX_ConfigToolLib/Resources/const.json create mode 100644 tools/config/TRX_ConfigToolLib/Resources/styles.xaml create mode 100644 tools/config/TRX_ConfigToolLib/TRX_ConfigToolLib.csproj create mode 100644 tools/config/TRX_ConfigToolLib/Utils/AssemblyUtils.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/BaseNotifyPropertyChanged.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/BindingProxy.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/Converters/BoolToVisibilityConverter.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/Converters/ConditionalMarkupConverter.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/Converters/ConditionalViewTextConverter.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/Json/NumericConverter.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/Json/PropertyConverter.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/Json/PropertyResolver.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/JsonUtils.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/MessageBoxUtils.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/NumericValidationRule.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/ProcessUtils.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/RelayCommand.cs create mode 100644 tools/config/TRX_ConfigToolLib/Utils/VisualUtils.cs diff --git a/tools/config/.gitignore b/tools/config/.gitignore new file mode 100644 index 0000000..7645b76 --- /dev/null +++ b/tools/config/.gitignore @@ -0,0 +1,15 @@ +*.suo +*.o +*.obj +*.pdb +*.lib +*.exp +[Dd]ebug/ +[Rr]elease/ +[Oo]bj/ +*.user +*.ipch +.vs/ +*.vcxproj +*.filters +*.pubxml diff --git a/tools/config/TRX_ConfigToolLib.sln b/tools/config/TRX_ConfigToolLib.sln new file mode 100644 index 0000000..efff011 --- /dev/null +++ b/tools/config/TRX_ConfigToolLib.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35219.272 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TRX_ConfigToolLib", "TRX_ConfigToolLib\TRX_ConfigToolLib.csproj", "{27F08E8C-2910-4682-B8BC-96ED4C1ECE54}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {27F08E8C-2910-4682-B8BC-96ED4C1ECE54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {27F08E8C-2910-4682-B8BC-96ED4C1ECE54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27F08E8C-2910-4682-B8BC-96ED4C1ECE54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {27F08E8C-2910-4682-B8BC-96ED4C1ECE54}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BA21B1D5-1CC7-4ED8-8C79-A1A5B0ACC840} + EndGlobalSection +EndGlobal diff --git a/tools/config/TRX_ConfigToolLib/Controls/AboutWindow.xaml b/tools/config/TRX_ConfigToolLib/Controls/AboutWindow.xaml new file mode 100644 index 0000000..13e1b0f --- /dev/null +++ b/tools/config/TRX_ConfigToolLib/Controls/AboutWindow.xaml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +