forked from NewLifeX/XAgent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FrmMain.cs
72 lines (61 loc) · 1.94 KB
/
FrmMain.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
using System;
using System.Reflection;
using System.Windows.Forms;
using NewLife.Reflection;
namespace XAgent
{
/// <summary>服务主界面</summary>
public partial class FrmMain : Form
{
#region 初始化
/// <summary>初始化</summary>
public FrmMain()
{
InitializeComponent();
}
private void FrmMain_Load(object sender, EventArgs e)
{
//this.Visible = false;
AssemblyX ax = AssemblyX.Create(Assembly.GetEntryAssembly());
String msg = String.Format("{0} {1} v{2}", ax.Title, ax.Name, ax.Version);
Text = msg;
}
#endregion
#region 托盘图标
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
Visible = true;
}
private void 主界面ToolStripMenuItem_Click(object sender, EventArgs e)
{
Visible = true;
BringToFront();
}
private void 启动ToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void 关于ToolStripMenuItem_Click(object sender, EventArgs e)
{
AssemblyX ax = AssemblyX.Create(Assembly.GetEntryAssembly());
String msg = String.Format("{0} {1} v{2}", ax.Description, ax.Name, ax.Version);
MessageBox.Show(msg);
}
#endregion
private void timer1_Tick(object sender, EventArgs e)
{
//TODO: 刷服务状态
}
private void FrmMain_Shown(object sender, EventArgs e)
{
//this.Visible = false;
}
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing)
{
Visible = false;
e.Cancel = true;
}
}
}
}