CLScriptTestor.Form1.button11_Click C# (CSharp) Method

button11_Click() private method

private button11_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void button11_Click(object sender, EventArgs e)
        {
            //scriptService.ClearCodeCache();
            int rightcount = 0;
            foreach (string file in listCodeFile.Items)
            {
                string code = System.IO.File.ReadAllText(file);
                //code=code.Replace("\r", "");
                CSLE.CLS_Content.Value v = null;
                var token = scriptService.tokenParser.Parse(code);
                try
                {

                    var vexpr = this.scriptService.Expr_CompilerToken(token, false);
                    v = this.scriptService.Expr_Execute(vexpr);
                }
                catch
                {
                    try
                    {
                        var vexpr = this.scriptService.Expr_CompilerToken(token, true);
                        v = this.scriptService.Expr_Execute(vexpr);

                    }
                    catch
                    {
                        v = null;
                    }
                }
                if (v != null)
                {
                    Log("result=<" + v.type.Name + ">" + v.value);
                    rightcount++;
                }
                else
                {
                    Log_Error(file);
                }

            }
            Log("succ=(" + rightcount + "/" + listCodeFile.Items.Count + ")");
        }