Пример #1
0
        internal override T Execute <T>(T current)
        {
            var operation = Invoker as OperationInvoker <T>;

            if (null == operation)
            {
                var function = Invoker as FunctionInvoker <T>;
                if (null != function)
                {
                    for (int i = 0; i < Count; i++)
                    {
                        try
                        {
                            if (null != IntervalImp)
                            {
                                IntervalImp.Execute(current);
                            }
                            if (!Dispatcher <T> .LastOperationSucceeded)
                            {
                                current = function.Execute(current);
                            }
                            break;
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e);
                        }
                    }

                    return(current);
                }
            }
            else
            {
                for (int i = 0; i < Count; i++)
                {
                    if (false == operation.Operation.SuccessResult)
                    {
                        if (null != IntervalImp)
                        {
                            IntervalImp.Execute(current);
                        }
                        current = operation.Execute(current);
                    }
                    else
                    {
                        break;
                    }
                }
            }

            return(current);
        }
Пример #2
0
        internal override T Execute <T>(T current)
        {
            var method = Invoker as MethodInvoker <T>;

            if (null == method)
            {
                return(current);
            }

            for (int i = 0; i < Count; i++)
            {
                current = method.Execute(current);
                if (null != IntervalImp)
                {
                    IntervalImp.Execute(current);
                }
            }

            return(current);
        }