PeekPreviewSettings.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.Text.Json; 6 7 using Microsoft.PowerToys.Settings.UI.Library; 8 using Microsoft.PowerToys.Settings.UI.Library.Interfaces; 9 10 namespace Settings.UI.Library 11 { 12 public class PeekPreviewSettings : ISettingsConfig 13 { 14 public const string FileName = "preview-settings.json"; 15 16 public BoolProperty SourceCodeWrapText { get; set; } 17 18 public BoolProperty SourceCodeTryFormat { get; set; } 19 20 public IntProperty SourceCodeFontSize { get; set; } 21 22 public BoolProperty SourceCodeStickyScroll { get; set; } 23 24 public BoolProperty SourceCodeMinimap { get; set; } 25 26 public PeekPreviewSettings() 27 { 28 SourceCodeWrapText = new BoolProperty(false); 29 SourceCodeTryFormat = new BoolProperty(false); 30 SourceCodeFontSize = new IntProperty(14); 31 SourceCodeStickyScroll = new BoolProperty(true); 32 SourceCodeMinimap = new BoolProperty(false); 33 } 34 35 public string ToJsonString() 36 { 37 return JsonSerializer.Serialize(this, Microsoft.PowerToys.Settings.UI.Library.SettingsSerializationContext.Default.PeekPreviewSettings); 38 } 39 40 public string GetModuleName() 41 { 42 return PeekSettings.ModuleName; 43 } 44 45 public bool UpgradeSettingsConfiguration() 46 { 47 return false; 48 } 49 } 50 }