From f38d2a6cb0e0531620556380a85e919c2e3f83de Mon Sep 17 00:00:00 2001 From: "Gergely Z. Toth" Date: Mon, 24 Jan 2022 05:12:54 +0100 Subject: [PATCH 1/2] Target Framework is updated to .Net Framework 4.8 --- src/FlaUInspect/App.config | 2 +- src/FlaUInspect/FlaUInspect.csproj | 2 +- src/FlaUInspect/Properties/AssemblyInfo.cs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/FlaUInspect/App.config b/src/FlaUInspect/App.config index 8bde09a..fc51563 100644 --- a/src/FlaUInspect/App.config +++ b/src/FlaUInspect/App.config @@ -1,7 +1,7 @@ - + diff --git a/src/FlaUInspect/FlaUInspect.csproj b/src/FlaUInspect/FlaUInspect.csproj index 26a4194..55c20df 100644 --- a/src/FlaUInspect/FlaUInspect.csproj +++ b/src/FlaUInspect/FlaUInspect.csproj @@ -9,7 +9,7 @@ Properties FlaUInspect FlaUInspect - v4.7.1 + v4.8 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/src/FlaUInspect/Properties/AssemblyInfo.cs b/src/FlaUInspect/Properties/AssemblyInfo.cs index 0585bd0..5973cc6 100644 --- a/src/FlaUInspect/Properties/AssemblyInfo.cs +++ b/src/FlaUInspect/Properties/AssemblyInfo.cs @@ -7,7 +7,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Roemer")] [assembly: AssemblyProduct("FlaUInspect")] -[assembly: AssemblyCopyright("Copyright © 2016-2017")] +[assembly: AssemblyCopyright("Copyright © 2016-2022")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -22,6 +22,6 @@ // app, or any theme specific resource dictionaries) )] -[assembly: AssemblyVersion("1.3.0")] -[assembly: AssemblyFileVersion("1.3.0")] -[assembly: AssemblyInformationalVersion("1.3.0")] +[assembly: AssemblyVersion("1.4.0")] +[assembly: AssemblyFileVersion("1.4.0")] +[assembly: AssemblyInformationalVersion("1.4.0")] From d074d5ef16685490b2a5f61af2de761ab2481b27 Mon Sep 17 00:00:00 2001 From: "Gergely Z. Toth" Date: Mon, 24 Jan 2022 06:12:50 +0100 Subject: [PATCH 2/2] AutomationType (Version) can also be configured by appsettings.json file --- README.md | 2 ++ src/FlaUInspect/App.xaml.cs | 28 ++++++++++++++-- src/FlaUInspect/FlaUInspect.csproj | 36 +++++++++------------ src/FlaUInspect/Settings/FlaUInspect.cs | 9 ++++++ src/FlaUInspect/ViewModels/MainViewModel.cs | 8 ++++- src/FlaUInspect/Views/MainWindow.xaml.cs | 19 +++++++---- src/FlaUInspect/appsettings.json | 5 +++ 7 files changed, 77 insertions(+), 30 deletions(-) create mode 100644 src/FlaUInspect/Settings/FlaUInspect.cs create mode 100644 src/FlaUInspect/appsettings.json diff --git a/README.md b/README.md index a8fbee9..6949136 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ On startup, you can choose if you want to use UIA2 or UIA3 (see [FAQ](https://gi ###### Choose Version Dialog ![Choose Version](https://raw.githubusercontent.com/wiki/FlauTech/FlaUInspect/images/choose_version.png) +Version could also specified in appsettings.json file. If you do this, the application will start silently, i.e. 'Choose Version Dialog' will not pop up + ###### Main Screen ![Main Screen](https://raw.githubusercontent.com/wiki/FlauTech/FlaUInspect/images/main_screen.png) diff --git a/src/FlaUInspect/App.xaml.cs b/src/FlaUInspect/App.xaml.cs index 9f569c1..a5bc151 100644 --- a/src/FlaUInspect/App.xaml.cs +++ b/src/FlaUInspect/App.xaml.cs @@ -1,9 +1,33 @@ -namespace FlaUInspect +using Microsoft.Extensions.Configuration; +using System; +using System.IO; +using System.Windows; + +namespace FlaUInspect { /// /// Interaction logic for App.xaml /// - public partial class App + public partial class App : Application { + private static Lazy configuration = new Lazy(ReadConfiguration); + + public static new App Current => (App)Application.Current; + + public Settings.FlaUInspect Configuration => configuration.Value; + + private static Settings.FlaUInspect ReadConfiguration() + { + IConfigurationRoot configuration = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: false) + .Build(); + + // Read the configuration settings + var setting = new Settings.FlaUInspect(); + configuration.Bind(nameof(Settings.FlaUInspect), setting); + + return setting; + } } } diff --git a/src/FlaUInspect/FlaUInspect.csproj b/src/FlaUInspect/FlaUInspect.csproj index 55c20df..414a73a 100644 --- a/src/FlaUInspect/FlaUInspect.csproj +++ b/src/FlaUInspect/FlaUInspect.csproj @@ -64,6 +64,12 @@ + + + + + + MSBuild:Compile @@ -76,6 +82,7 @@ + @@ -126,6 +133,9 @@ + + PreserveNewest + @@ -143,7 +153,12 @@ + + + + + @@ -159,30 +174,9 @@ - - - - - - - - - - - - - - - - 3.2.0 - - - 3.2.0 - -