コード例 #1
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);
 }
コード例 #2
0
 public bool AddCode(string code, bool noevent = false)
 {
     Clear();
     try {
         //var main = _compiler.Modules.Add("Main");
         _compiler.AddCode(code);
         return(true);
     } catch {
         if (_error == null)
         {
             throw;
         }
         _error.FillParentTrace();
         if (OnError != null && !noevent)
         {
             OnError(_error);
         }
         return(false);
     }
 }