/ src / modules / MeasureTool / MeasureToolUI / Settings.cs
Settings.cs
 1  // Copyright (c) Microsoft Corporation
 2  // The Microsoft Corporation licenses this file to you under the MIT license.
 3  // See the LICENSE file in the project root for more information.
 4  
 5  using System.IO;
 6  
 7  using Microsoft.PowerToys.Settings.UI.Library;
 8  using Settings.UI.Library.Enumerations;
 9  
10  namespace MeasureToolUI
11  {
12      public sealed class Settings
13      {
14          private static readonly SettingsUtils ModuleSettings = SettingsUtils.Default;
15  
16          public MeasureToolMeasureStyle DefaultMeasureStyle
17          {
18              get
19              {
20                  try
21                  {
22                      return (MeasureToolMeasureStyle)ModuleSettings.GetSettings<MeasureToolSettings>(MeasureToolSettings.ModuleName).Properties.DefaultMeasureStyle.Value;
23                  }
24                  catch (FileNotFoundException)
25                  {
26                      return MeasureToolMeasureStyle.None;
27                  }
28              }
29          }
30      }
31  }