ModuleHotkeyData.cs
1 // Copyright (c) Microsoft Corporation 2 // The Microsoft Corporation licenses this file to you under the MIT license. 3 // See the LICENSE file in the project root for more information. 4 5 using System.ComponentModel; 6 using System.Runtime.CompilerServices; 7 using ManagedCommon; 8 using Microsoft.PowerToys.Settings.UI.Library.Helpers; 9 using Windows.Web.AtomPub; 10 11 namespace Microsoft.PowerToys.Settings.UI.Library.HotkeyConflicts 12 { 13 public class ModuleHotkeyData : INotifyPropertyChanged 14 { 15 private string _moduleName; 16 private int _hotkeyID; 17 private HotkeySettings _hotkeySettings; 18 private bool _isSystemConflict; 19 20 public event PropertyChangedEventHandler PropertyChanged; 21 22 public string IconPath { get; set; } 23 24 public string DisplayName { get; set; } 25 26 public string Header { get; set; } 27 28 protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) 29 { 30 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 31 } 32 33 public string ModuleName 34 { 35 get => _moduleName; 36 set 37 { 38 if (_moduleName != value) 39 { 40 _moduleName = value; 41 } 42 } 43 } 44 45 public int HotkeyID 46 { 47 get => _hotkeyID; 48 set 49 { 50 if (_hotkeyID != value) 51 { 52 _hotkeyID = value; 53 } 54 } 55 } 56 57 public HotkeySettings HotkeySettings 58 { 59 get => _hotkeySettings; 60 set 61 { 62 if (_hotkeySettings != value) 63 { 64 _hotkeySettings = value; 65 OnPropertyChanged(); 66 } 67 } 68 } 69 70 public bool IsSystemConflict 71 { 72 get => _isSystemConflict; 73 set 74 { 75 if (_isSystemConflict != value) 76 { 77 _isSystemConflict = value; 78 } 79 } 80 } 81 82 public ModuleType ModuleType { get; set; } 83 } 84 }