2020-07-10 17:07:28 -07: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-19 13:32:05 -07:00
|
|
|
|
using System;
|
2020-07-10 17:07:28 -07:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
2020-10-22 09:45:48 -07:00
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Library
|
2020-07-10 17:07:28 -07:00
|
|
|
|
{
|
|
|
|
|
|
public class AppSpecificKeysDataModel : KeysDataModel
|
|
|
|
|
|
{
|
|
|
|
|
|
[JsonPropertyName("targetApp")]
|
|
|
|
|
|
public string TargetApp { get; set; }
|
|
|
|
|
|
|
2020-10-09 17:58:52 -07:00
|
|
|
|
public new List<string> GetMappedOriginalKeys()
|
2020-07-10 17:07:28 -07:00
|
|
|
|
{
|
2020-10-09 17:58:52 -07:00
|
|
|
|
return base.GetMappedOriginalKeys();
|
2020-07-10 17:07:28 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-10-09 17:58:52 -07:00
|
|
|
|
public new List<string> GetMappedNewRemapKeys()
|
2020-07-10 17:07:28 -07:00
|
|
|
|
{
|
2020-10-09 17:58:52 -07:00
|
|
|
|
return base.GetMappedNewRemapKeys();
|
2020-07-10 17:07:28 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Compare(AppSpecificKeysDataModel arg)
|
|
|
|
|
|
{
|
2023-11-22 12:46:59 -05:00
|
|
|
|
ArgumentNullException.ThrowIfNull(arg);
|
2020-10-19 13:32:05 -07:00
|
|
|
|
|
|
|
|
|
|
// Using Ordinal comparison for internal text
|
2023-11-23 11:46:07 +01:00
|
|
|
|
return string.Equals(OriginalKeys, arg.OriginalKeys, StringComparison.Ordinal) &&
|
|
|
|
|
|
string.Equals(NewRemapKeys, arg.NewRemapKeys, StringComparison.Ordinal) &&
|
|
|
|
|
|
string.Equals(NewRemapString, arg.NewRemapString, StringComparison.Ordinal) &&
|
|
|
|
|
|
string.Equals(TargetApp, arg.TargetApp, StringComparison.Ordinal);
|
2020-07-10 17:07:28 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|