コード例 #1
0
ファイル: RuleEditFrm.cs プロジェクト: mzh99/BUM
        private bool TryCompile(string script)
        {
            string err;

            if (script == string.Empty)
            {
                DiagTB.Text = "No script code to compile";
                return(false);
            }
            ScriptRunner.CompileScript(script, out err);
            if (err == string.Empty)
            {
                DiagTB.Text = $"Successful compile at: {DateTime.Now}";
                return(true);
            }
            DiagTB.Text = "Compile Errors:\r\n" + err;
            return(false);
        }
コード例 #2
0
ファイル: ScriptRunner.cs プロジェクト: mzh99/BUM
 public CompiledExclusionRule(RuleAppliesTo appliesTo, string scriptCode)
 {
     this.AppliesTo    = appliesTo;
     this.CompiledCode = ScriptRunner.CompileScript(scriptCode, out compileErrors);
 }