Example #1
0
 public override CompileResult Compile(IEnumerable<Expression> children, ParsingContext context)
 {
     var args = new List<FunctionArgument>();
     Function.BeforeInvoke(context);
     foreach (var child in children)
     {
         var compileResult = child.Compile();
         if (compileResult.IsResultOfSubtotal)
         {
             var arg = new FunctionArgument(compileResult.Result);
             arg.SetExcelStateFlag(ExcelCellState.IsResultOfSubtotal);
             args.Add(arg);
         }
         else
         {
             BuildFunctionArguments(compileResult.Result, args);     
         }
     }
     return Function.Execute(args, context);
 }
Example #2
0
 public void ShouldSetExcelState()
 {
     var arg = new FunctionArgument(2);
     arg.SetExcelStateFlag(ExcelCellState.HiddenCell);
     Assert.IsTrue(arg.ExcelStateFlagIsSet(ExcelCellState.HiddenCell));
 }