mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[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:
30
src/modules/MeasureTool/MeasureToolUI/Settings.cs
Normal file
30
src/modules/MeasureTool/MeasureToolUI/Settings.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user