1
- using Flow . Launcher . Helper ;
2
- using Flow . Launcher . Infrastructure . UserSettings ;
3
- using System . Collections . ObjectModel ;
4
- using System . ComponentModel ;
1
+ using System . Collections . ObjectModel ;
5
2
using System . Linq ;
6
3
using System . Windows ;
7
4
using System . Windows . Input ;
8
5
using System . Windows . Controls ;
6
+ using Flow . Launcher . Helper ;
7
+ using Flow . Launcher . Infrastructure . UserSettings ;
9
8
10
9
namespace Flow . Launcher
11
10
{
12
11
public partial class CustomQueryHotkeySetting : Window
13
12
{
14
- private readonly Settings _settings ;
13
+ public Settings Settings { get ; set ; }
14
+
15
15
private bool update ;
16
16
private CustomPluginHotkey updateCustomHotkey ;
17
- public event PropertyChangedEventHandler PropertyChanged ;
18
-
19
- public string SettingWindowFont
20
- {
21
- get => _settings . SettingWindowFont ;
22
- set
23
- {
24
- if ( _settings . SettingWindowFont != value )
25
- {
26
- _settings . SettingWindowFont = value ;
27
- OnPropertyChanged ( nameof ( SettingWindowFont ) ) ;
28
- }
29
- }
30
- }
31
-
32
- protected virtual void OnPropertyChanged ( string propertyName )
33
- {
34
- PropertyChanged ? . Invoke ( this , new PropertyChangedEventArgs ( propertyName ) ) ;
35
- }
17
+
36
18
public CustomQueryHotkeySetting ( Settings settings )
37
19
{
38
- _settings = settings ;
20
+ Settings = settings ;
39
21
InitializeComponent ( ) ;
40
22
}
41
23
@@ -48,13 +30,13 @@ private void btnAdd_OnClick(object sender, RoutedEventArgs e)
48
30
{
49
31
if ( ! update )
50
32
{
51
- _settings . CustomPluginHotkeys ??= new ObservableCollection < CustomPluginHotkey > ( ) ;
33
+ Settings . CustomPluginHotkeys ??= new ObservableCollection < CustomPluginHotkey > ( ) ;
52
34
53
35
var pluginHotkey = new CustomPluginHotkey
54
36
{
55
37
Hotkey = HotkeyControl . CurrentHotkey . ToString ( ) , ActionKeyword = tbAction . Text
56
38
} ;
57
- _settings . CustomPluginHotkeys . Add ( pluginHotkey ) ;
39
+ Settings . CustomPluginHotkeys . Add ( pluginHotkey ) ;
58
40
59
41
HotKeyMapper . SetCustomQueryHotkey ( pluginHotkey ) ;
60
42
}
@@ -73,7 +55,7 @@ private void btnAdd_OnClick(object sender, RoutedEventArgs e)
73
55
74
56
public void UpdateItem ( CustomPluginHotkey item )
75
57
{
76
- updateCustomHotkey = _settings . CustomPluginHotkeys . FirstOrDefault ( o =>
58
+ updateCustomHotkey = Settings . CustomPluginHotkeys . FirstOrDefault ( o =>
77
59
o . ActionKeyword == item . ActionKeyword && o . Hotkey == item . Hotkey ) ;
78
60
if ( updateCustomHotkey == null )
79
61
{
0 commit comments