2020-04-08 01:19:14 +08: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-20 04:32:05 +08:00
|
|
|
|
using System;
|
2020-04-02 21:08:56 +08:00
|
|
|
|
using System.Text.Json.Serialization;
|
2020-09-24 04:20:32 +08:00
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Lib.Interface;
|
2020-04-02 21:08:56 +08:00
|
|
|
|
|
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Lib
|
|
|
|
|
{
|
2020-09-24 04:20:32 +08:00
|
|
|
|
public class PowerRenameSettings : BasePTModuleSettings, ISettingsConfig
|
2020-04-02 21:08:56 +08:00
|
|
|
|
{
|
2020-07-22 05:06:39 +08:00
|
|
|
|
public const string ModuleName = "PowerRename";
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("properties")]
|
|
|
|
|
public PowerRenameProperties Properties { get; set; }
|
2020-04-02 21:08:56 +08:00
|
|
|
|
|
|
|
|
|
public PowerRenameSettings()
|
|
|
|
|
{
|
2020-07-22 05:06:39 +08:00
|
|
|
|
Properties = new PowerRenameProperties();
|
|
|
|
|
Version = "1";
|
|
|
|
|
Name = ModuleName;
|
2020-04-18 06:25:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PowerRenameSettings(PowerRenameLocalProperties localProperties)
|
|
|
|
|
{
|
2020-10-20 04:32:05 +08:00
|
|
|
|
if (localProperties == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentNullException(nameof(localProperties));
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-22 05:06:39 +08: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-04-18 06:25:08 +08:00
|
|
|
|
|
2020-07-22 05:06:39 +08:00
|
|
|
|
Version = "1";
|
|
|
|
|
Name = ModuleName;
|
2020-04-02 21:08:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PowerRenameSettings(string ptName)
|
|
|
|
|
{
|
2020-07-22 05:06:39 +08:00
|
|
|
|
Properties = new PowerRenameProperties();
|
|
|
|
|
Version = "1";
|
|
|
|
|
Name = ptName;
|
2020-04-02 21:08:56 +08:00
|
|
|
|
}
|
2020-09-24 04:20:32 +08: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 21:08:56 +08:00
|
|
|
|
}
|
2020-04-08 15:19:00 +08:00
|
|
|
|
}
|