Exemple #1
0
        public PipelineBuilder(PipelineModifications modifications)
        {
            coordinator = new BehaviorRegistrationsCoordinator(modifications.Removals, modifications.Replacements);

            RegisterIncomingCoreBehaviors();
            RegisterOutgoingCoreBehaviors();
            RegisterAdditionalBehaviors(modifications.Additions);

            var model = coordinator.BuildRuntimeModel();

            Incoming = new List <RegisterStep>();
            Outgoing = new List <RegisterStep>();
            var behaviorType        = typeof(IBehavior <>);
            var outgoingContextType = typeof(OutgoingContext);
            var incomingContextType = typeof(IncomingContext);

            foreach (var rego in model)
            {
                if (behaviorType.MakeGenericType(incomingContextType).IsAssignableFrom(rego.BehaviorType))
                {
                    Incoming.Add(rego);
                }

                if (behaviorType.MakeGenericType(outgoingContextType).IsAssignableFrom(rego.BehaviorType))
                {
                    Outgoing.Add(rego);
                }
            }
        }
        public PipelineBuilder(PipelineModifications modifications)
        {
            coordinator = new BehaviorRegistrationsCoordinator(modifications.Removals, modifications.Replacements);

            RegisterIncomingCoreBehaviors();
            RegisterOutgoingCoreBehaviors();
            RegisterAdditionalBehaviors(modifications.Additions);

            var model = coordinator.BuildRuntimeModel();
            Incoming = new List<RegisterStep>();
            Outgoing = new List<RegisterStep>();
            var behaviorType = typeof(IBehavior<>);
            var outgoingContextType = typeof(OutgoingContext);
            var incomingContextType = typeof(IncomingContext);

            foreach (var rego in model)
            {
                if (behaviorType.MakeGenericType(incomingContextType).IsAssignableFrom(rego.BehaviorType))
                {
                    Incoming.Add(rego);
                }

                if (behaviorType.MakeGenericType(outgoingContextType).IsAssignableFrom(rego.BehaviorType))
                {
                    Outgoing.Add(rego);
                }
            }
        }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of <see cref="PipelineSettings" />.
 /// </summary>
 internal PipelineSettings(PipelineModifications modifications, SettingsHolder settings) : base(settings)
 {
     this.modifications = modifications;
 }
 /// <summary>
 /// Initializes a new instance of <see cref="PipelineSettings" />.
 /// </summary>
 internal PipelineSettings(PipelineModifications modifications)
 {
     this.modifications = modifications;
 }