Resolve "Component: Settings" #69

Merged
thorsten merged 32 commits from 13-component-settings into main 2022-08-05 19:35:32 +00:00
Showing only changes of commit 506a21e792 - Show all commits
@@ -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;