From eac5fa3268620d2a69d5421f190d665269505c3f Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 9 Jul 2022 16:00:23 +0200 Subject: [PATCH] Fixed app starting, when user just closes the loading screen Closes #21 --- I18N Commander/UI WinForms/Components/LoaderStart.cs | 4 ++-- I18N Commander/UI WinForms/Loader.cs | 1 + I18N Commander/UI WinForms/Program.cs | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/I18N Commander/UI WinForms/Components/LoaderStart.cs b/I18N Commander/UI WinForms/Components/LoaderStart.cs index 00726f7..ebc99d2 100644 --- a/I18N Commander/UI WinForms/Components/LoaderStart.cs +++ b/I18N Commander/UI WinForms/Components/LoaderStart.cs @@ -13,10 +13,10 @@ public partial class LoaderStart : UserControl this.InitializeComponent(); } - private static RegistryKey I18NCommanderKey => Registry.CurrentUser.OpenSubKey("Software", RegistryKeyPermissionCheck.ReadWriteSubTree)!.CreateSubKey("I18N Commander", RegistryKeyPermissionCheck.ReadWriteSubTree); - #region Recent Projects + private static RegistryKey I18NCommanderKey => Registry.CurrentUser.OpenSubKey("Software", RegistryKeyPermissionCheck.ReadWriteSubTree)!.CreateSubKey("I18N Commander", RegistryKeyPermissionCheck.ReadWriteSubTree); + /// /// Gets or sets the list of recent projects without any extras e.g. it does not prune the list of projects. /// diff --git a/I18N Commander/UI WinForms/Loader.cs b/I18N Commander/UI WinForms/Loader.cs index 4f525ca..38065c7 100644 --- a/I18N Commander/UI WinForms/Loader.cs +++ b/I18N Commander/UI WinForms/Loader.cs @@ -12,6 +12,7 @@ public partial class Loader : Form private void loaderStart_LoadProject(object sender, string projectFilePath) { this.DataFile = projectFilePath; + this.DialogResult = DialogResult.OK; this.Close(); } } \ No newline at end of file diff --git a/I18N Commander/UI WinForms/Program.cs b/I18N Commander/UI WinForms/Program.cs index fbb744a..4f3d673 100644 --- a/I18N Commander/UI WinForms/Program.cs +++ b/I18N Commander/UI WinForms/Program.cs @@ -21,6 +21,10 @@ internal static class Program var loader = new Loader(); Application.Run(loader); + // Check, if the user closes the loader screen: + if (loader.DialogResult != DialogResult.OK) + return; + // // Create the DI system //