Optimizations

This commit is contained in:
Thorsten Sommer 2022-07-26 19:48:30 +02:00
parent b86e057122
commit 506a21e792
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -52,19 +52,14 @@ public partial class Setting : UserControl
}; };
// Setup the change event handler: // Setup the change event handler:
dropdown.SelectedValueChanged += async (sender, args) => dropdown.SelectedValueChanged += async (sender, args) => await AppSettings.SetDeepLMode(dropdown.SelectedIndex switch
{ {
var newSetting = dropdown.SelectedIndex switch 0 => SettingDeepL.DISABLED,
{ 1 => SettingDeepL.USE_FREE_ACCOUNT,
0 => SettingDeepL.DISABLED, 2 => SettingDeepL.USE_PRO_ACCOUNT,
1 => SettingDeepL.USE_FREE_ACCOUNT,
2 => SettingDeepL.USE_PRO_ACCOUNT,
_ => SettingDeepL.DISABLED, _ => SettingDeepL.DISABLED,
}; });
await AppSettings.SetDeepLMode(newSetting);
};
// Apply the desired layout: // Apply the desired layout:
dropdown.Dock = DockStyle.Fill; dropdown.Dock = DockStyle.Fill;