Skip to content

Commit b6115fa

Browse files
committed
Add quick switch pair model
1 parent 683d4fa commit b6115fa

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using Flow.Launcher.Plugin;
2+
3+
namespace Flow.Launcher.Infrastructure.QuickSwitch;
4+
5+
public class QuickSwitchExplorerPair
6+
{
7+
public IQuickSwitchExplorer Plugin { get; init; }
8+
9+
public PluginMetadata Metadata { get; init; }
10+
11+
public override string ToString()
12+
{
13+
return Metadata.Name;
14+
}
15+
16+
public override bool Equals(object obj)
17+
{
18+
if (obj is QuickSwitchExplorerPair r)
19+
{
20+
return string.Equals(r.Metadata.ID, Metadata.ID);
21+
}
22+
else
23+
{
24+
return false;
25+
}
26+
}
27+
28+
public override int GetHashCode()
29+
{
30+
var hashcode = Metadata.ID?.GetHashCode() ?? 0;
31+
return hashcode;
32+
}
33+
}
34+
35+
public class QuickSwitchDialogPair
36+
{
37+
public IQuickSwitchDialog Plugin { get; init; }
38+
39+
public PluginMetadata Metadata { get; init; }
40+
41+
public override string ToString()
42+
{
43+
return Metadata.Name;
44+
}
45+
46+
public override bool Equals(object obj)
47+
{
48+
if (obj is QuickSwitchDialogPair r)
49+
{
50+
return string.Equals(r.Metadata.ID, Metadata.ID);
51+
}
52+
else
53+
{
54+
return false;
55+
}
56+
}
57+
58+
public override int GetHashCode()
59+
{
60+
var hashcode = Metadata.ID?.GetHashCode() ?? 0;
61+
return hashcode;
62+
}
63+
}

0 commit comments

Comments
 (0)