-
Notifications
You must be signed in to change notification settings - Fork 0
/
yuyan.xaml.cs
101 lines (94 loc) · 2.76 KB
/
yuyan.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace ManaTranslation
{
/// <summary>
/// yuyan.xaml 的交互逻辑
/// </summary>
public partial class yuyan : Window
{
TranClass tranClass = new TranClass();
private static yuyan staticInstance = null;
int toClick;
public yuyan()
{
InitializeComponent();
this.Closed += WindowOnClosed;
this.ShowInTaskbar = false;//禁止窗口显示在任务栏
toClick = Properties.Settings.Default.myClick;
switch (toClick)
{
case 1:
rad1.IsChecked = true;
tranClass.From = "auto";
tranClass.To = "auto";
toClick = 1;
break;
case 2:
rad2.IsChecked = true;
tranClass.To = "jp";
toClick = 2;
break;
case 3:
rad3.IsChecked = true;
tranClass.To = "kor";
toClick = 3;
break;
case 4:
rad4.IsChecked = true;
tranClass.To = "spa";
toClick = 4;
break;
default:
break;
}
}
public static yuyan GetInstance(double x,double y)
{
if(staticInstance == null)
{
staticInstance = new yuyan();
staticInstance.Top = x;
staticInstance.Left = y;
}
return staticInstance;
}
private void rad1_click(object sender, RoutedEventArgs e)
{
toClick = 1;
}
private void btn_Close(object sender, MouseButtonEventArgs e)
{
Properties.Settings.Default.myClick = toClick;
Properties.Settings.Default.Save();
this.Close();
}
private void rad4_click(object sender, RoutedEventArgs e)
{
toClick = 4;
}
private void rad3_click(object sender, RoutedEventArgs e)
{
toClick = 3;
}
private void rad2_click(object sender, RoutedEventArgs e)
{
toClick = 2;
}
private void WindowOnClosed(object sender,System.EventArgs e)
{
staticInstance = null;
}
}
}