Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += Application_ThreadException;

            bool isFirstInstance;
            using (Mutex mtx = new Mutex(true, "DevTools", out isFirstInstance))
            {
                if (isFirstInstance)
                {
                    try
                    {
                        Config.ConfigBase config = new DevToolsConfig();
                        config = Config.ConfigManager.GetConfig(config.Key);
                        Language.LanguageManager.Code = (config as DevToolsConfig).Language;
                        using (MenuManager menu = new MenuManager())
                        {
                            menu.Show();
                            Application.Run();
                        }
                    }
                    catch (Exception ex)
                    {
                        DTLogger logger = new DTLogger();
                        logger.Error(ex);
                    }
                    finally
                    {
                        mtx.ReleaseMutex();
                    }
                }
            }
        }
Ejemplo n.º 2
0
 static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
 {
     DTLogger logger = new DTLogger();
     logger.Error(e.Exception);
 }
Ejemplo n.º 3
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     DTLogger logger = new DTLogger();
     logger.Debug("Delete Files");
 }