From 9cd735ad5c5cdaa20e7d436bf05b4f6b8f0b1414 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 30 Jul 2022 16:38:07 +0200 Subject: [PATCH] Moved the dock setting into constructor --- .../UI WinForms/Components/Setting.Designer.cs | 2 +- I18N Commander/UI WinForms/Components/Setting.cs | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/I18N Commander/UI WinForms/Components/Setting.Designer.cs b/I18N Commander/UI WinForms/Components/Setting.Designer.cs index 50e35a5..c78b1e7 100644 --- a/I18N Commander/UI WinForms/Components/Setting.Designer.cs +++ b/I18N Commander/UI WinForms/Components/Setting.Designer.cs @@ -1,6 +1,6 @@ namespace UI_WinForms.Components { - partial class Setting + sealed partial class Setting { /// /// Required designer variable. diff --git a/I18N Commander/UI WinForms/Components/Setting.cs b/I18N Commander/UI WinForms/Components/Setting.cs index 411c5bb..e7a6966 100644 --- a/I18N Commander/UI WinForms/Components/Setting.cs +++ b/I18N Commander/UI WinForms/Components/Setting.cs @@ -4,7 +4,7 @@ using UI_WinForms.Resources; namespace UI_WinForms.Components; -public partial class Setting : UserControl +public sealed partial class Setting : UserControl { public Setting() { @@ -14,6 +14,7 @@ public partial class Setting : UserControl private Setting(SettingUIData settingMetaData) { this.InitializeComponent(); + this.Dock = DockStyle.Top; this.labelIcon.Image = settingMetaData.Icon; this.labelSettingName.Text = settingMetaData.SettingName(); this.labelExplanation.Text = settingMetaData.SettingExplanation(); @@ -85,10 +86,7 @@ public partial class Setting : UserControl } ); - return new Setting(settingData) - { - Dock = DockStyle.Top, - }; + return new Setting(settingData); } private static async Task ShowDeepLAPIKeySettingAsync() @@ -108,10 +106,7 @@ public partial class Setting : UserControl } ); - return new Setting(settingData) - { - Dock = DockStyle.Top, - }; + return new Setting(settingData); } public static IEnumerable> GetAllSettings()