public override TotemValue Execute(TotemArguments arguments) { arguments = arguments ?? new TotemArguments(); using (var scope = new ScopeWrapper(this)) { scope.Declare("arguments"); scope.Set("arguments", arguments); for (int i = 0; i < parametersDefinition.Length; i++) { var param = parametersDefinition[i]; if (arguments.IsSet(i)) { scope.Declare(param.Name); scope.Set(param.Name, arguments.Value(i)); } else if (arguments.IsSet(param.Name)) { scope.Declare(param.Name); scope.Set(param.Name, arguments.Value(param.Name)); } } try { return(TotemRun()); } catch (Exception e) { throw;// new TotemException(e); } } }
public virtual TotemValue Execute(TotemArguments arguments) { throw new InvalidOperationException("Can't execute on a " + GetType()); }