Optimizations
This commit is contained in:
parent
b86e057122
commit
506a21e792
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user