2020-08-18 01:00:56 +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.
|
|
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
2020-09-24 04:20:32 +08:00
|
|
|
|
using System.Text.Json;
|
2020-08-18 01:00:56 +08:00
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
2020-10-23 00:45:48 +08:00
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Library
|
2020-08-18 01:00:56 +08:00
|
|
|
|
{
|
|
|
|
|
public class ShortcutsKeyDataModel
|
|
|
|
|
{
|
2020-10-20 04:32:05 +08:00
|
|
|
|
// Suppressing these warnings because removing the setter breaks
|
|
|
|
|
// deserialization with System.Text.Json. This affects the UI display.
|
|
|
|
|
// See: https://github.com/dotnet/runtime/issues/30258
|
2020-08-18 01:00:56 +08:00
|
|
|
|
[JsonPropertyName("global")]
|
2020-10-20 04:32:05 +08:00
|
|
|
|
#pragma warning disable CA2227 // Collection properties should be read only
|
2020-08-18 01:00:56 +08:00
|
|
|
|
public List<KeysDataModel> GlobalRemapShortcuts { get; set; }
|
2020-10-20 04:32:05 +08:00
|
|
|
|
#pragma warning restore CA2227 // Collection properties should be read only
|
2020-08-18 01:00:56 +08:00
|
|
|
|
|
|
|
|
|
[JsonPropertyName("appSpecific")]
|
2020-10-20 04:32:05 +08:00
|
|
|
|
#pragma warning disable CA2227 // Collection properties should be read only
|
2020-08-18 01:00:56 +08:00
|
|
|
|
public List<AppSpecificKeysDataModel> AppSpecificRemapShortcuts { get; set; }
|
2020-10-20 04:32:05 +08:00
|
|
|
|
#pragma warning restore CA2227 // Collection properties should be read only
|
2020-08-18 01:00:56 +08:00
|
|
|
|
|
|
|
|
|
public ShortcutsKeyDataModel()
|
|
|
|
|
{
|
|
|
|
|
GlobalRemapShortcuts = new List<KeysDataModel>();
|
|
|
|
|
AppSpecificRemapShortcuts = new List<AppSpecificKeysDataModel>();
|
|
|
|
|
}
|
2020-09-24 04:20:32 +08:00
|
|
|
|
|
|
|
|
|
public string ToJsonString()
|
|
|
|
|
{
|
|
|
|
|
return JsonSerializer.Serialize(this);
|
|
|
|
|
}
|
2020-08-18 01:00:56 +08:00
|
|
|
|
}
|
|
|
|
|
}
|