Example #1
0
 public override void Run(IExecutionContext context)
 {
     if(IsInitializer)
     {
         context.InitVariable(Name);
     }
 }
Example #2
0
 public void AssignValue(IExecutionContext context, object val)
 {
     if(IsInitializer)
         context.InitVariable(Name, val);
     else
         context.SetVariable(Name, val);
 }
Example #3
0
        public bool Handle(IExecutionContext context, object errObject)
        {
            if(errObject is TargetInvocationException)
                errObject = ((TargetInvocationException)errObject).InnerException;

            if(errObject is ScriptCustomException)
                errObject = ((ScriptCustomException)errObject).CustomObject;

            if(ExceptionType != null)
            {
                if(errObject != null)
                    return false;
                Type catchType = TypeLiteral.FindType(ExceptionType);
                Type errType = errObject.GetType();
                if(errType != catchType && !errType.IsSubclassOf(catchType))
                    return false;
            }

            if(ID != null)
                context.InitVariable(ID, errObject);

            if(Handler != null)
                Handler.Run(context);

            return true;
        }
Example #4
0
 public override object Eval(IExecutionContext context)
 {
     if(IsInitializer)
     {
         context.InitVariable(Name);
     }
     object result = context.GetVariable(Name);
     if(result == SpecialValue.VariableNotSet)
         throw new VariableNotInitialized(Name);
     return result;
 }
Example #5
0
        public override object Eval(IExecutionContext context)
        {
            this.Context = context.CreateChildContext();

            Parameters.Run(context);

            if(this.Name != null)
                context.InitVariable(this.Name, this);

            return this;
        }