Ejemplo n.º 1
0
        static void Main()
        {
            onBoot();

            Application.ThreadException += new ThreadExceptionEventHandler(applicationThreadException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(currentDomainUnhandledException);
            SystemEvents.SessionEnding += new SessionEndingEventHandler(sessionEnding);

            Mutex procMutex = new Mutex(false, APP_IDENT);

            if (procMutex.WaitOne(0) && GlobalProcMtx.Create(APP_IDENT, APP_TITLE))
            {
                checkSelfDir();
                Directory.SetCurrentDirectory(selfDir);
                checkAloneExe();
                checkLogonUser();

                Utils.AntiWindowsDefenderSmartScreen();

                Gnd.i.loadConf();
                Gnd.i.loadData();

                Gnd.i.n2Listener   = new N2Listener();
                Gnd.i.problemInfos = ProblemInfoUtils.loadProblemInfos();

                // おまけ、ゴミ掃除
                {
                    File.Delete("Error.csv");
                    File.Delete("LoadedData.csv");
                }

                Utils.WriteLog("Main 1.1");

                // orig >

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new MainWin());

                // < orig

                // ここではフォームを開けない -----> MainWin_FormClosed()

                Utils.WriteLog("Main 2.1");

                Gnd.i.saveData();

                Utils.WriteLog("Main 2.2");

                FileTools.clearTMP();

                Utils.WriteLog("Main 2.3");

                GlobalProcMtx.Release();
                procMutex.ReleaseMutex();
            }
            procMutex.Close();
        }
Ejemplo n.º 2
0
 public ProblemInfo getProblemInfo()
 {
     return(ProblemInfoUtils.get(getPIName()));
 }