User/lamotile/add powerrename settings (#1813)

* added powerrename settings

* removed pop-up message

* removed unused files

* revrted changes to old settings

* updated solution file

* added ToJsonString() method

* added JSON property for the powertoy name
This commit is contained in:
Lavius Motileng
2020-04-02 06:08:56 -07:00
parent 3015ffd950
commit 89b44f5126
16 changed files with 346 additions and 125 deletions

View File

@@ -5,24 +5,18 @@ using System.Text.Json;
namespace Microsoft.PowerToys.Settings.UI.Lib
{
/// <summary>
/// PowerToys runner expects a json text that contains one of the following attributes: refresh, general and powertoys.
/// The one for general settings is placed in the General settings model. This class represents the json text that starts with the "powertoys" attribute.
/// this will tell the runner that we are sending settings for a powertoy module and not for general settings.
/// </summary>
/// <typeparam name="M">M stands for the Model of PT Module Settings to be sent.</typeparam>
public class SndModuleSettings<M>
public class SndModuleSettings<S>
{
public M powertoys { get; set; }
public S powertoys { get; set; }
public SndModuleSettings(M ptModuleSettings)
public SndModuleSettings(S settings)
{
this.powertoys = ptModuleSettings;
this.powertoys = settings;
}
public override string ToString()
public string ToJsonString()
{
return "{\"powertoys\":" + this.powertoys.ToString() + "}";
return JsonSerializer.Serialize(this);
}
}
}