コード例 #1
0
 public bool Eval(string code, out object result)
 {
     Clean();
     try {
         result = _msc_compiler.Eval(code);
         return(true);
     } catch (Exception ex) {
         if (_error == null && !ExitException.Is(ex))
         {
             throw;
         }
         _error.FillParentTrace();
         result = null;
         return(false);
     }
 }
コード例 #2
0
 public bool Execute(string code, bool noevent = false)
 {
     Clean();
     try {
         _msc_compiler.AddCode(code);
     } catch (Exception ex) {
         if (_error == null && !ExitException.Is(ex))
         {
             throw;
         }
     }
     if (_error == null)
     {
         return(true);
     }
     _error.FillParentTrace();
     if (OnError != null && !noevent)
     {
         OnError(_error);
     }
     return(false);
 }