Skip to content

Commit 5c2127e

Browse files
committed
Add constructor for CustomPluginHotkey
1 parent 4fcc12d commit 5c2127e

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed
Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
1-
using Flow.Launcher.Plugin;
1+
using System;
2+
using Flow.Launcher.Plugin;
23

34
namespace Flow.Launcher.Infrastructure.UserSettings
45
{
56
public class CustomPluginHotkey : BaseModel
67
{
78
public string Hotkey { get; set; }
89
public string ActionKeyword { get; set; }
10+
11+
public CustomPluginHotkey(string hotkey, string actionKeyword)
12+
{
13+
Hotkey = hotkey;
14+
ActionKeyword = actionKeyword;
15+
}
16+
17+
public override bool Equals(object other)
18+
{
19+
if (other is CustomPluginHotkey otherHotkey)
20+
{
21+
return Hotkey == otherHotkey.Hotkey && ActionKeyword == otherHotkey.ActionKeyword;
22+
}
23+
24+
return false;
25+
}
26+
27+
public override int GetHashCode()
28+
{
29+
return HashCode.Combine(Hotkey, ActionKeyword);
30+
}
931
}
1032
}

0 commit comments

Comments
 (0)