예제 #1
0
        private void BG_DoWork(object sender, DoWorkEventArgs e)
        {
            string ErrorText;
            string DLLFilename;

            PackageCompiler = new PackageCompiler();
            PackageCompiler.OnStatusUpdate += PackageCompiler_OnStatusUpdate;
            if (PackageCompiler.CheckScript(Package, out ErrorText) == false)
            {
                e.Result = ErrorText;
                e.Cancel = false;
                Debug.WriteLine("BG_DoWork() canceled");
                return;
            }

            if (PackageCompiler.CompileScript(Package.Script, out ErrorText, "", out DLLFilename) == null)
            {
                e.Result = ErrorText;
                e.Cancel = false;
                Debug.WriteLine("BG_DoWork() canceled (Compiler)");
                return;
            }

            if (PackageCompiler.CompilePackage(Package, (PKGCompilerArgs)e.Argument, out ErrorText) == false)
            {
                e.Result = ErrorText;
                e.Cancel = false;
                Debug.WriteLine("BG_DoWork() canceled (2)");
                return;
            }
            e.Cancel = false;
            e.Result = true;
            Debug.WriteLine("BG_DoWork() done");
        }
예제 #2
0
        private void testCompilePackageScriptToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Package.Script = txtScript.Text;
            string ErrorText = "";
            string DLLFilename;

            if (PackageCompiler.CompileScript(Package.Script, out ErrorText, "", out DLLFilename) == null)
            {
                MessageBox.Show(this, ErrorText, Program.AppTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            MessageBox.Show(this, "No errors.", Program.AppTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }