public PipelineBuilder(PipelineModifications modifications) { coordinator = new StepRegistrationsCoordinator(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 void Setup() { removals = new List <RemoveStep>(); replacements = new List <ReplaceStep>(); coordinator = new StepRegistrationsCoordinator(removals, replacements); }
public void Setup() { replacements = new List <ReplaceStep>(); addOrReplacements = new List <RegisterOrReplaceStep>(); coordinator = new StepRegistrationsCoordinator(replacements, addOrReplacements); }