Esempio n. 1
0
 protected virtual void OnAfterEval(AfterEvalEventArgs args)
 {
     EventHandler<AfterEvalEventArgs> handler = AfterEval;
     if (handler != null)
         handler(this, args);
 }
Esempio n. 2
0
        //.........................................................................
        public virtual object Eval(object o)
        {
            object result = null;
            BeforeEvalEventArgs args = new BeforeEvalEventArgs(o);
            OnBeforeEval(args);
            if (!args.Cancel && args.Eval != null) {
                Exception e = null;
                try {
                    result = Interpreter.Eval(args.Eval);
                    Debug(result);
                } catch (Exception ex) {
                    e = ex;
                    Debug(FormatException(ex));
                    if (result == null)
                        result = ex;
                }
                AfterEvalEventArgs args2 = new AfterEvalEventArgs(args.Eval, result, e);
                OnAfterEval(args2);
                /*if (e != null && !(e is LispException) && !args2.ExceptionHandled)
                    throw e;*/
            }

            return result;
        }