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 Microsoft.CmdPal.Ext.Calc.Helper;
 6  
 7  namespace Microsoft.CmdPal.Ext.Calc.UnitTests;
 8  
 9  public class Settings : ISettingsInterface
10  {
11      private readonly CalculateEngine.TrigMode trigUnit;
12      private readonly bool inputUseEnglishFormat;
13      private readonly bool outputUseEnglishFormat;
14      private readonly bool closeOnEnter;
15      private readonly bool copyResultToSearchBarIfQueryEndsWithEqualSign;
16      private readonly bool autoFixQuery;
17      private readonly bool inputNormalization;
18  
19      public Settings(
20          CalculateEngine.TrigMode trigUnit = CalculateEngine.TrigMode.Radians,
21          bool inputUseEnglishFormat = false,
22          bool outputUseEnglishFormat = false,
23          bool closeOnEnter = true,
24          bool copyResultToSearchBarIfQueryEndsWithEqualSign = true,
25          bool autoFixQuery = true,
26          bool inputNormalization = true)
27      {
28          this.trigUnit = trigUnit;
29          this.inputUseEnglishFormat = inputUseEnglishFormat;
30          this.outputUseEnglishFormat = outputUseEnglishFormat;
31          this.closeOnEnter = closeOnEnter;
32          this.copyResultToSearchBarIfQueryEndsWithEqualSign = copyResultToSearchBarIfQueryEndsWithEqualSign;
33          this.autoFixQuery = autoFixQuery;
34          this.inputNormalization = inputNormalization;
35      }
36  
37      public CalculateEngine.TrigMode TrigUnit => trigUnit;
38  
39      public bool InputUseEnglishFormat => inputUseEnglishFormat;
40  
41      public bool OutputUseEnglishFormat => outputUseEnglishFormat;
42  
43      public bool CloseOnEnter => closeOnEnter;
44  
45      public bool CopyResultToSearchBarIfQueryEndsWithEqualSign => copyResultToSearchBarIfQueryEndsWithEqualSign;
46  
47      public bool AutoFixQuery => autoFixQuery;
48  
49      public bool InputNormalization => inputNormalization;
50  }