PowerRenameSettings.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; 6 using System.Text.Json.Serialization; 7 8 using Microsoft.PowerToys.Settings.UI.Library.Interfaces; 9 10 namespace Microsoft.PowerToys.Settings.UI.Library 11 { 12 public class PowerRenameSettings : BasePTModuleSettings, ISettingsConfig 13 { 14 public const string ModuleName = "PowerRename"; 15 16 [JsonPropertyName("properties")] 17 public PowerRenameProperties Properties { get; set; } 18 19 public PowerRenameSettings() 20 { 21 Properties = new PowerRenameProperties(); 22 Version = "1"; 23 Name = ModuleName; 24 } 25 26 public PowerRenameSettings(PowerRenameLocalProperties localProperties) 27 { 28 ArgumentNullException.ThrowIfNull(localProperties); 29 30 Properties = new PowerRenameProperties(); 31 Properties.PersistState.Value = localProperties.PersistState; 32 Properties.MRUEnabled.Value = localProperties.MRUEnabled; 33 Properties.MaxMRUSize.Value = localProperties.MaxMRUSize; 34 Properties.ShowIcon.Value = localProperties.ShowIcon; 35 Properties.ExtendedContextMenuOnly.Value = localProperties.ExtendedContextMenuOnly; 36 Properties.UseBoostLib.Value = localProperties.UseBoostLib; 37 38 Version = "1"; 39 Name = ModuleName; 40 } 41 42 public PowerRenameSettings(string ptName) 43 { 44 Properties = new PowerRenameProperties(); 45 Version = "1"; 46 Name = ptName; 47 } 48 49 public string GetModuleName() 50 { 51 return Name; 52 } 53 54 // This can be utilized in the future if the power-rename-settings.json file is to be modified/deleted. 55 public bool UpgradeSettingsConfiguration() 56 { 57 return false; 58 } 59 } 60 }