Program.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using CommonLang.Log;
  2. using CommonLang.Property;
  3. using CommonLang.Xml;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Threading;
  8. using System.Windows.Forms;
  9. using XmdsBattleClientBot;
  10. using XmdsBattleClientBot.Bot;
  11. namespace XmdsBattleClientWin32
  12. {
  13. static class Program
  14. {
  15. public static bool ARG_TC { get; private set; }
  16. public static bool AUTO_LOGIN { get; private set; }
  17. /// <summary>
  18. /// 应用程序的主入口点。
  19. /// </summary>
  20. [STAThread]
  21. static void Main(params string[] args)
  22. {
  23. ReflectionUtil.LoadDlls(new System.IO.DirectoryInfo(Application.StartupPath));
  24. Application.EnableVisualStyles();
  25. Application.SetCompatibleTextRenderingDefault(false);
  26. HashSet<string> args_set = new HashSet<string>(args);
  27. if (args_set.Count > 0)
  28. {
  29. AUTO_LOGIN = true;
  30. ARG_TC = args_set.Contains("-tc");
  31. }
  32. var launcher = new FormLauncher();
  33. launcher.OnStart += Launcher_OnStart;
  34. Application.Run(launcher);
  35. //TODO 2017/1/22 CommonSecure.ConnectWS.Run(launcher);
  36. }
  37. private static void Launcher_OnStart(FormLauncher sender, XmdsBattleClientBot.BotConfig config)
  38. {
  39. var bot = new WinForm.FormBot();
  40. bot.FormClosed += (s2, e2) =>
  41. {
  42. sender.Close();
  43. };
  44. bot.Show();
  45. }
  46. }
  47. }