2020-04-07 10:19:14 -07:00
|
|
|
|
// 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.
|
|
|
|
|
|
|
2020-10-19 13:32:05 -07:00
|
|
|
|
using System;
|
2020-04-02 06:08:56 -07:00
|
|
|
|
using System.Text.Json.Serialization;
|
2024-10-17 05:14:57 -04:00
|
|
|
|
|
2020-10-22 09:45:48 -07:00
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
|
2020-04-02 06:08:56 -07:00
|
|
|
|
|
2020-10-22 09:45:48 -07:00
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Library
|
2020-04-02 06:08:56 -07:00
|
|
|
|
{
|
2020-09-23 13:20:32 -07:00
|
|
|
|
public class PowerRenameSettings : BasePTModuleSettings, ISettingsConfig
|
2020-04-02 06:08:56 -07:00
|
|
|
|
{
|
2020-07-21 14:06:39 -07:00
|
|
|
|
public const string ModuleName = "PowerRename";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("properties")]
|
|
|
|
|
|
public PowerRenameProperties Properties { get; set; }
|
2020-04-02 06:08:56 -07:00
|
|
|
|
|
|
|
|
|
|
public PowerRenameSettings()
|
|
|
|
|
|
{
|
2020-07-21 14:06:39 -07:00
|
|
|
|
Properties = new PowerRenameProperties();
|
|
|
|
|
|
Version = "1";
|
|
|
|
|
|
Name = ModuleName;
|
2020-04-17 15:25:08 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public PowerRenameSettings(PowerRenameLocalProperties localProperties)
|
|
|
|
|
|
{
|
2023-11-22 12:46:59 -05:00
|
|
|
|
ArgumentNullException.ThrowIfNull(localProperties);
|
2020-10-19 13:32:05 -07:00
|
|
|
|
|
2020-07-21 14:06:39 -07:00
|
|
|
|
Properties = new PowerRenameProperties();
|
|
|
|
|
|
Properties.PersistState.Value = localProperties.PersistState;
|
|
|
|
|
|
Properties.MRUEnabled.Value = localProperties.MRUEnabled;
|
|
|
|
|
|
Properties.MaxMRUSize.Value = localProperties.MaxMRUSize;
|
|
|
|
|
|
Properties.ShowIcon.Value = localProperties.ShowIcon;
|
|
|
|
|
|
Properties.ExtendedContextMenuOnly.Value = localProperties.ExtendedContextMenuOnly;
|
2020-11-09 19:13:43 +01:00
|
|
|
|
Properties.UseBoostLib.Value = localProperties.UseBoostLib;
|
2020-04-17 15:25:08 -07:00
|
|
|
|
|
2020-07-21 14:06:39 -07:00
|
|
|
|
Version = "1";
|
|
|
|
|
|
Name = ModuleName;
|
2020-04-02 06:08:56 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public PowerRenameSettings(string ptName)
|
|
|
|
|
|
{
|
2020-07-21 14:06:39 -07:00
|
|
|
|
Properties = new PowerRenameProperties();
|
|
|
|
|
|
Version = "1";
|
|
|
|
|
|
Name = ptName;
|
2020-04-02 06:08:56 -07:00
|
|
|
|
}
|
2020-09-23 13:20:32 -07:00
|
|
|
|
|
|
|
|
|
|
public string GetModuleName()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Name;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// This can be utilized in the future if the power-rename-settings.json file is to be modified/deleted.
|
|
|
|
|
|
public bool UpgradeSettingsConfiguration()
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2020-04-02 06:08:56 -07:00
|
|
|
|
}
|
2020-04-08 00:19:00 -07:00
|
|
|
|
}
|