代码拉取完成,页面将自动刷新
同步操作将从 notmmao/D3AutoClick 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* Created by SharpDevelop.
* User: notmmao
* Date: 2015/5/29
* Time: 15:16
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Diagnostics;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
namespace D3AutoClick
{
public sealed class NotificationIcon
{
private NotifyIcon notifyIcon;
private ContextMenu notificationMenu;
#region Initialize icon and menu
public NotificationIcon()
{
notifyIcon = new NotifyIcon();
notificationMenu = new ContextMenu(InitializeMenu());
notifyIcon.DoubleClick += IconDoubleClick;
notifyIcon.Icon = (Icon)D3AutoClick.Properties.Resources.Logo;
notifyIcon.ContextMenu = notificationMenu;
}
private MenuItem[] InitializeMenu()
{
MenuItem[] menu = new MenuItem[] {
new MenuItem("About", menuAboutClick),
new MenuItem("Exit", menuExitClick),
};
return menu;
}
#endregion
#region Main - Program entry point
/// <summary>Program entry point.</summary>
/// <param name="args">Command Line Arguments</param>
[STAThread]
public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
bool isFirstInstance;
// Please use a unique name for the mutex to prevent conflicts with other programs
using (Mutex mtx = new Mutex(true, "D3AutoClick", out isFirstInstance)) {
if (isFirstInstance) {
NotificationIcon notificationIcon = new NotificationIcon();
notificationIcon.notifyIcon.Visible = true;
Splash.ShowSplashScreen();
Thread.Sleep(1000 * 2);
if (Splash.SplashScreen != null)
{
Splash.SplashScreen.Dispose();
}
Application.Run(Form2.Instance);
notificationIcon.notifyIcon.Dispose();
} else {
// The application is already running
// TODO: Display message box or change focus to existing application instance
Win32Api.ShowRemote();
}
} // releases the Mutex
}
#endregion
#region Event Handlers
private void menuAboutClick(object sender, EventArgs e)
{
MessageBox.Show(Splash.Message, "About");
}
private void menuExitClick(object sender, EventArgs e)
{
Form2.Instance.Close();
Application.Exit();
Environment.Exit(0);
}
private void IconDoubleClick(object sender, EventArgs e)
{
Form2.Instance.Show();
Form2.Instance.WindowState = FormWindowState.Normal;
}
#endregion
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。