Exemple #1
0
 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);
         }
     }
 }
Exemple #2
0
 public virtual TotemValue Execute(TotemArguments arguments)
 {
     throw new InvalidOperationException("Can't execute on a " + GetType());
 }