2020-04-08 15:19:00 +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-04-04 10:02:38 +08:00
|
|
|
|
|
2020-04-27 04:15:40 +08:00
|
|
|
|
using System.Text.Json;
|
2020-07-22 05:06:39 +08:00
|
|
|
|
using System.Text.Json.Serialization;
|
2020-04-27 04:15:40 +08:00
|
|
|
|
|
2020-04-04 10:02:38 +08:00
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Lib
|
|
|
|
|
{
|
|
|
|
|
public class PowerLauncherSettings : BasePTModuleSettings
|
|
|
|
|
{
|
2020-07-22 05:06:39 +08:00
|
|
|
|
public const string ModuleName = "PowerToys Run";
|
2020-04-27 04:15:40 +08:00
|
|
|
|
|
2020-07-22 05:06:39 +08:00
|
|
|
|
[JsonPropertyName("properties")]
|
|
|
|
|
public PowerLauncherProperties Properties { get; set; }
|
2020-04-08 15:19:00 +08:00
|
|
|
|
|
2020-04-04 10:02:38 +08:00
|
|
|
|
public PowerLauncherSettings()
|
|
|
|
|
{
|
2020-07-22 05:06:39 +08:00
|
|
|
|
Properties = new PowerLauncherProperties();
|
|
|
|
|
Version = "1";
|
|
|
|
|
Name = ModuleName;
|
2020-04-04 10:02:38 +08:00
|
|
|
|
}
|
2020-04-27 04:15:40 +08:00
|
|
|
|
|
|
|
|
|
public virtual void Save()
|
|
|
|
|
{
|
|
|
|
|
// Save settings to file
|
|
|
|
|
var options = new JsonSerializerOptions
|
|
|
|
|
{
|
|
|
|
|
WriteIndented = true,
|
|
|
|
|
};
|
|
|
|
|
|
2020-07-22 05:06:39 +08:00
|
|
|
|
SettingsUtils.SaveSettings(JsonSerializer.Serialize(this, options), ModuleName);
|
2020-04-27 04:15:40 +08:00
|
|
|
|
}
|
2020-04-04 10:02:38 +08:00
|
|
|
|
}
|
|
|
|
|
}
|