Exemple #1
0
        /// <summary>
        /// Configures injection of the given <see cref="IOutgoingStep"/>, positioning it relative to another step
        /// specified by <paramref name="anchorStep"/>. The relative position is specified with either
        /// <see cref="PipelineRelativePosition.Before"/> or <see cref="PipelineRelativePosition.After"/>
        /// </summary>
        public PipelineStepInjector OnSend(IOutgoingStep step, PipelineRelativePosition position, Type anchorStep)
        {
            if (step == null) throw new ArgumentNullException(nameof(step));
            if (anchorStep == null) throw new ArgumentNullException(nameof(anchorStep));

            _outgoingInjectedSteps
                .GetOrAdd(anchorStep, _ => new List<Tuple<PipelineRelativePosition, IOutgoingStep>>())
                .Add(Tuple.Create(position, step));

            return this;
        }
 /// <summary>
 /// Sets the specified outgoing <paramref name="step"/> to be concatenated at the position specified by <paramref name="position"/>
 /// </summary>
 public PipelineStepConcatenator OnSend(IOutgoingStep step, PipelineAbsolutePosition position)
 {
     if (position == PipelineAbsolutePosition.Front)
     {
         _outgoingFrontSteps.Add(step);
     }
     else
     {
         _outgoingBackSteps.Add(step);
     }
     return this;
 }
Exemple #3
0
 /// <summary>
 /// Sets the specified outgoing <paramref name="step"/> to be concatenated at the position specified by <paramref name="position"/>
 /// </summary>
 public PipelineStepConcatenator OnSend(IOutgoingStep step, PipelineAbsolutePosition position)
 {
     if (position == PipelineAbsolutePosition.Front)
     {
         _outgoingFrontSteps.Add(step);
     }
     else
     {
         _outgoingBackSteps.Add(step);
     }
     return(this);
 }
 /// <summary>
 /// Sets the specified outgoing <paramref name="step"/> to be concatenated at the position specified by <paramref name="position"/>
 /// </summary>
 public PipelineStepConcatenator OnSend(IOutgoingStep step, PipelineAbsolutePosition position)
 {
     if (step == null) throw new ArgumentNullException(nameof(step));
     if (position == PipelineAbsolutePosition.Front)
     {
         _outgoingFrontSteps.Add(step);
     }
     else
     {
         _outgoingBackSteps.Add(step);
     }
     return this;
 }
Exemple #5
0
 /// <summary>
 /// Sets the specified outgoing <paramref name="step"/> to be concatenated at the position specified by <paramref name="position"/>
 /// </summary>
 public PipelineStepConcatenator OnSend(IOutgoingStep step, PipelineAbsolutePosition position)
 {
     if (step == null)
     {
         throw new ArgumentNullException(nameof(step));
     }
     if (position == PipelineAbsolutePosition.Front)
     {
         _outgoingFrontSteps.Add(step);
     }
     else
     {
         _outgoingBackSteps.Add(step);
     }
     return(this);
 }
Exemple #6
0
        public static OptionsConfigurer RegisterOutgoingStep(this OptionsConfigurer configurer,
                                                             IOutgoingStep stepToInject,
                                                             PipelineRelativePosition position = PipelineRelativePosition.Before,
                                                             Type anchorStep = null)
        {
            anchorStep = anchorStep ?? typeof(SendOutgoingMessageStep);
            configurer.Decorate <IPipeline>(c =>
            {
                var pipeline = c.Get <IPipeline>();

                return(new PipelineStepInjector(pipeline)
                       .OnSend(stepToInject, position, anchorStep));
            });

            return(configurer);
        }
 bool HasMatch(IOutgoingStep step)
 {
     return _outgoingStepPredicates.Any(p => p(step));
 }
        /// <summary>
        /// Configures injection of the given <see cref="IOutgoingStep"/>, positioning it relative to another step
        /// specified by <paramref name="anchorStep"/>. The relative position is specified with either
        /// <see cref="PipelineRelativePosition.Before"/> or <see cref="PipelineRelativePosition.After"/>
        /// </summary>
        public PipelineStepInjector OnSend(IOutgoingStep step, PipelineRelativePosition position, Type anchorStep)
        {
            if (step == null) throw new ArgumentNullException("step");
            if (anchorStep == null) throw new ArgumentNullException("anchorStep");

            _outgoingInjectedSteps
                .GetOrAdd(anchorStep, _ => new List<Tuple<PipelineRelativePosition, IOutgoingStep>>())
                .Add(Tuple.Create(position, step));

            return this;
        }
Exemple #9
0
 bool HasMatch(IOutgoingStep step)
 {
     return(_outgoingStepPredicates.Any(p => p(step)));
 }
Exemple #10
0
 /// <summary>
 /// Adds a new outgoing step to the send pipeline
 /// </summary>
 public DefaultPipeline OnSend(IOutgoingStep step)
 {
     _sendSteps.Add(step);
     return(this);
 }
Exemple #11
0
 /// <summary>
 /// Adds a new outgoing step to the send pipeline
 /// </summary>
 public DefaultPipeline OnSend(IOutgoingStep step)
 {
     _sendSteps.Add(step);
     return this;
 }