示例#1
0
        private static async void ApplicationOnEnterIdle(object sender, EventArgs e)
        {
            // Don't want to run more than once
            Application.Idle -= ApplicationOnEnterIdle;

            try
            {
                var updateStatus = await Services.CreateInstance <UpdateForm>().CheckForUpdatesAsync();

                if (updateStatus != UpdateForm.Result.NoUpdateNeeded)
                {
                    Application.Exit();
                    return;
                }

                var javaCheckPassed = await JavaChecker.CheckJavaAsync();

                if (!javaCheckPassed)
                {
                    Application.Exit();
                    return;
                }

                var mainForm = Services.CreateInstance <MainForm>();

                mainForm.Closing += (o, args) => Application.Exit();
                mainForm.Show();
            }
            catch (Exception ex)
            {
                Console.WriteLine($"An exception occurred during program startup: {ex}{LF}{LF}");
                Application.Exit();
            }
        }
示例#2
0
 public void Init()
 {
     _cSharpChecker = new CSharpChecker();
     _javaChecker   = new JavaChecker
     {
         JavaPath         = Helpers.GetJavaExePath(@"bin\java.exe"),
         JavaCompilerPath = Helpers.GetJavaExePath(@"bin\javac.exe"),
         ClassName        = "Program"
     };
     _phpChecker = new PhpChecker
     {
         PhpPath = @"C:\xampp\php\php.exe",
     };
 }