RtApplication.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7. namespace Venus_RT
  8. {
  9. internal class RtApplication : ApplicationContext
  10. {
  11. private NotifyIcon _notifyIcon = new NotifyIcon();
  12. public RtApplication()
  13. {
  14. MenuItem configMenuItem = new MenuItem(string.Format("Login RT Server(&L)"), new EventHandler(ConfirmLogin1));
  15. MenuItem exitMenuItem = new MenuItem(string.Format("Exit RT Server(&Q)"), new EventHandler(ConfirmExit));
  16. _notifyIcon.ContextMenu = new ContextMenu(new MenuItem[] { configMenuItem, exitMenuItem });
  17. _notifyIcon.Visible = true;
  18. _notifyIcon.Text = "Venus_RT";
  19. _notifyIcon.Icon = new System.Drawing.Icon("logos/venus.ico");
  20. }
  21. private void ConfirmLogin1(object sender, EventArgs e)
  22. {
  23. }
  24. private void ConfirmExit(object sender, EventArgs e)
  25. {
  26. Environment.Exit(0);
  27. }
  28. }
  29. }