-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVDesktopConfiguration.cs
More file actions
76 lines (64 loc) · 1.74 KB
/
VDesktopConfiguration.cs
File metadata and controls
76 lines (64 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System.Windows.Forms;
namespace VirtualDesktopHelper;
public class HotKeyConfiguration
{
public bool HotKeyUsesShift { get; set; }
public bool HotKeyUsesCtrl { get; set; }
public bool HotKeyUsesAlt { get; set; }
public Keys? HotKeyKey { get; set; } = null;
public string HotKey
{
get
{
if (HotKeyKey == null)
{
return "none";
}
var result = HotKeyKey.Value.ToString();
if (HotKeyUsesShift)
{
result = "Shift+" + result;
}
if (HotKeyUsesAlt)
{
result = "Alt+" + result;
}
if(HotKeyUsesCtrl)
{
result = "Ctrl+" + result;
}
return result;
}
}
public HotKeyConfiguration Clone()
{
return new HotKeyConfiguration()
{
HotKeyUsesShift = HotKeyUsesShift,
HotKeyUsesCtrl = HotKeyUsesCtrl,
HotKeyUsesAlt = HotKeyUsesAlt,
HotKeyKey = HotKeyKey
};
}
public override string ToString()
{
return HotKey;
}
}
public class VDesktopConfiguration
{
public int Number { get; set; }
public string Name { get; set; }
public HotKeyConfiguration SwitchToHotKey { get; set; } = new HotKeyConfiguration();
public HotKeyConfiguration SendToHotKey { get; set; } = new HotKeyConfiguration();
public VDesktopConfiguration Clone()
{
return new VDesktopConfiguration()
{
Number = Number,
Name = Name,
SwitchToHotKey = SwitchToHotKey.Clone(),
SendToHotKey = SendToHotKey.Clone()
};
}
}