2020-07-11 08:07:28 +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-07-11 08:07:28 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
2020-10-23 00:45:48 +08:00
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Library
|
2020-07-11 08:07:28 +08:00
|
|
|
|
{
|
|
|
|
|
public class AppSpecificKeysDataModel : KeysDataModel
|
|
|
|
|
{
|
|
|
|
|
[JsonPropertyName("targetApp")]
|
|
|
|
|
public string TargetApp { get; set; }
|
|
|
|
|
|
2020-10-10 08:58:52 +08:00
|
|
|
|
public new List<string> GetMappedOriginalKeys()
|
2020-07-11 08:07:28 +08:00
|
|
|
|
{
|
2020-10-10 08:58:52 +08:00
|
|
|
|
return base.GetMappedOriginalKeys();
|
2020-07-11 08:07:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-10-10 08:58:52 +08:00
|
|
|
|
public new List<string> GetMappedNewRemapKeys()
|
2020-07-11 08:07:28 +08:00
|
|
|
|
{
|
2020-10-10 08:58:52 +08:00
|
|
|
|
return base.GetMappedNewRemapKeys();
|
2020-07-11 08:07:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Compare(AppSpecificKeysDataModel arg)
|
|
|
|
|
{
|
2020-10-20 04:32:05 +08:00
|
|
|
|
if (arg == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentNullException(nameof(arg));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Using Ordinal comparison for internal text
|
|
|
|
|
return OriginalKeys.Equals(arg.OriginalKeys, StringComparison.Ordinal) &&
|
|
|
|
|
NewRemapKeys.Equals(arg.NewRemapKeys, StringComparison.Ordinal) &&
|
|
|
|
|
TargetApp.Equals(arg.TargetApp, StringComparison.Ordinal);
|
2020-07-11 08:07:28 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|