[MeasureTool]Add setting to specify the default measure style (#25645)

* MeasureTool: Add possibility to specify the default measure style

* MeasureTool: Improve description of user setting

* MeasureTool: Use enum value instead of magic number
This commit is contained in:
Sebastian Zanoni
2023-04-27 16:38:24 +02:00
committed by GitHub
parent 4af9f0172d
commit 78d705890a
9 changed files with 130 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.IO;
using Microsoft.PowerToys.Settings.UI.Library;
using Settings.UI.Library.Enumerations;
namespace MeasureToolUI
{
public sealed class Settings
{
private static readonly SettingsUtils ModuleSettings = new();
public MeasureToolMeasureStyle DefaultMeasureStyle
{
get
{
try
{
return (MeasureToolMeasureStyle)ModuleSettings.GetSettings<MeasureToolSettings>(MeasureToolSettings.ModuleName).Properties.DefaultMeasureStyle.Value;
}
catch (FileNotFoundException)
{
return MeasureToolMeasureStyle.None;
}
}
}
}
}