Exemplo n.º 1
0
        public static CommandRtn ExecuteCol(this IExcelContext ctx, Collection <string> s, object v, out Action after)
        {
            var cr           = CommandRtn.None;
            var afterActions = new List <Action>();

            foreach (var cmd in ctx.CmdCols)
            {
                var r = cmd.Func(ctx, s, v);
                if ((r & CommandRtn.Execute) == CommandRtn.Execute)
                {
                    ctx.Frame = ctx.ExecuteCmd(cmd.Cmds, out Action action);
                    if (action != null)
                    {
                        afterActions.Add(action);
                    }
                }
                cr |= r;
            }
            after = afterActions.Count > 0 ? () => { foreach (var action in afterActions)
                                                     {
                                                         action?.Invoke();
                                                     }
            } : (Action)null;
            return(cr);
        }
Exemplo n.º 2
0
 void IExcelCommand.Execute(IExcelContext ctx, ref Action after)
 {
     ctx.Frames.Push(ctx.Frame);
     ctx.ExecuteCmd(Cmds, out after); //action?.Invoke();
 }