-
Notifications
You must be signed in to change notification settings - Fork 0
/
SetAppsForm.xaml.cs
102 lines (75 loc) · 2.8 KB
/
SetAppsForm.xaml.cs
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
using System.Windows;
namespace MapleDesktop2._0
{
/// <summary>
/// Interaction logic for SetAppsForm.xaml
/// </summary>
public partial class SetAppsForm : Window
{
internal static int appid = 0;
public SetAppsForm()
{
InitializeComponent();
}
internal void SetLinkId(int id)
{
appid = id;
lbl_Name.Content = $"Set QuickLink{id}";
}
internal void SetLink()
{
string link = "";
string name = "";
if (appid > 0)
{
switch (appid)
{
case 1:
link = txb_QuickAppPath.Text;
name = txb_QuickAppName.Text;
Properties.Settings.Default.QuickApp1 = link;
Properties.Settings.Default.QuickApp1Name = name;
Properties.Settings.Default.Save();
MainWindow.currentLinksForm.btn_QuickApp1.Content = name;
MainWindow.currentLinksForm.lbl_QuickApp1Name.Content = name;
break;
case 2:
link = txb_QuickAppPath.Text;
name = txb_QuickAppName.Text;
Properties.Settings.Default.QuickApp2 = link;
Properties.Settings.Default.QuickApp2Name = name;
Properties.Settings.Default.Save();
MainWindow.currentLinksForm.btn_QuickApp2.Content = name;
MainWindow.currentLinksForm.lbl_QuickApp2Name.Content = name;
break;
case 3:
link = txb_QuickAppPath.Text;
name = txb_QuickAppName.Text;
Properties.Settings.Default.QuickApp3 = link;
Properties.Settings.Default.QuickApp3Name = name;
Properties.Settings.Default.Save();
MainWindow.currentLinksForm.btn_QuickApp3.Content = name;
MainWindow.currentLinksForm.lbl_QuickApp3Name.Content = name;
break;
}
CancelWindow();
}
}
internal void CancelWindow()
{
this.Close();
}
private void btn_QuickAppSet_Click(object sender, RoutedEventArgs e)
{
SetLink();
}
private void btn_QuickAppCancel_Click(object sender, RoutedEventArgs e)
{
CancelWindow();
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
MainWindow.currentSetAppsFormOpen = false;
}
}
}