示例#1
0
文件: Program.cs 项目: xhominum/Robot
        private static void Main(string[] args)
        {
            if (!AttachConsole(ATTACH_PARENT_PROCESS))
            {
                AllocConsole();
            }

            System.Threading.Thread.Sleep(2000);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            try
            {
                GR.Initialize();
                Application.Run(new MainForm());
            }
            catch (Exception ex)
            {
                SimpleLogger.Logger.Log(ex.StackTrace + Environment.NewLine + ex.Message);
                GR.Instance.OutputCtrl.SetAllIngredientOff();
            }
            finally
            {
                GR.Instance.Dispose();
                FreeConsole();
            }
        }
示例#2
0
 public static void Initialize()
 {
     if (_inst != null)
     {
         throw new Exception("GlobalResources already initialized");
     }
     _inst = new GR();
 }