Esempio n. 1
0
        private object[] BeforeInvoke()
        {
            var stateRef   = new BeforeInvokeArgs.StateRef();
            var pipeStates = new object[_pipes.Count];

            for (var pipeIndex = 0; pipeIndex < _pipes.Count; ++pipeIndex)
            {
                var beforeInvokeArgs = new BeforeInvokeArgs(this, stateRef);
                _pipes[pipeIndex].BeforeInvoke(beforeInvokeArgs);
                pipeStates[pipeIndex] = beforeInvokeArgs.State;
            }
            return(pipeStates);
        }
Esempio n. 2
0
        private object?[] BeforeInvoke()
        {
            if (_pipes.Count == 0)
            {
                return(Array.Empty <object?>());
            }

            var stateRef   = new BeforeInvokeArgs.StateRef();
            var pipeStates = new object?[_pipes.Count];

            for (var pipeIndex = 0; pipeIndex < _pipes.Count; ++pipeIndex)
            {
                var beforeInvokeArgs = new BeforeInvokeArgs(this, stateRef);
                _pipes[pipeIndex].BeforeInvoke(beforeInvokeArgs);
                pipeStates[pipeIndex] = beforeInvokeArgs.State;
            }

            return(pipeStates);
        }