[PTRun][Calculator]Error check when loading trigonometry mode (#37033)
This commit is contained in:
Родитель
b6b941c55b
Коммит
0efdc94548
|
@ -13,6 +13,7 @@ using ManagedCommon;
|
||||||
using Microsoft.PowerToys.Run.Plugin.Calculator.Properties;
|
using Microsoft.PowerToys.Run.Plugin.Calculator.Properties;
|
||||||
using Microsoft.PowerToys.Settings.UI.Library;
|
using Microsoft.PowerToys.Settings.UI.Library;
|
||||||
using Wox.Plugin;
|
using Wox.Plugin;
|
||||||
|
using Wox.Plugin.Logger;
|
||||||
|
|
||||||
namespace Microsoft.PowerToys.Run.Plugin.Calculator
|
namespace Microsoft.PowerToys.Run.Plugin.Calculator
|
||||||
{
|
{
|
||||||
|
@ -212,8 +213,18 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator
|
||||||
var optionReplaceInput = settings.AdditionalOptions.FirstOrDefault(x => x.Key == ReplaceInput);
|
var optionReplaceInput = settings.AdditionalOptions.FirstOrDefault(x => x.Key == ReplaceInput);
|
||||||
replaceInput = optionReplaceInput?.Value ?? replaceInput;
|
replaceInput = optionReplaceInput?.Value ?? replaceInput;
|
||||||
|
|
||||||
var optionTrigMode = settings.AdditionalOptions.FirstOrDefault(x => x.Key == TrigMode);
|
try
|
||||||
trigMode = (CalculateEngine.TrigMode)int.Parse(optionTrigMode.ComboBoxValue.ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture);
|
{
|
||||||
|
var optionTrigMode = settings.AdditionalOptions.FirstOrDefault(x => x.Key == TrigMode);
|
||||||
|
if (optionTrigMode != null)
|
||||||
|
{
|
||||||
|
trigMode = (CalculateEngine.TrigMode)int.Parse(optionTrigMode.ComboBoxValue.ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Exception("Error while trying to load Trigonometry Mode setting: {ex.Message}", ex, GetType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_inputUseEnglishFormat = inputUseEnglishFormat;
|
_inputUseEnglishFormat = inputUseEnglishFormat;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче