/// <summary> /// Register a new step into the pipeline. /// </summary> /// <param name="stepId">The identifier of the new step to add.</param> /// <param name="behavior">The <see cref="Behavior{TContext}" /> to execute.</param> /// <param name="description">The description of the behavior.</param> public void Register(string stepId, Type behavior, string description) { BehaviorTypeChecker.ThrowIfInvalid(behavior, nameof(behavior)); Guard.AgainstNullAndEmpty(nameof(stepId), stepId); Guard.AgainstNullAndEmpty(nameof(description), description); modifications.Additions.Add(RegisterStep.Create(stepId, behavior, description)); }
/// <summary> /// Register a new step into the pipeline. /// </summary> /// <param name="stepId">The identifier of the new step to add.</param> /// <param name="behavior">The behavior instance.</param> /// <param name="description">The description of the behavior.</param> public void Register <T>(string stepId, T behavior, string description) where T : IBehavior { BehaviorTypeChecker.ThrowIfInvalid(typeof(T), nameof(behavior)); Guard.AgainstNullAndEmpty(nameof(stepId), stepId); Guard.AgainstNullAndEmpty(nameof(description), description); modifications.Additions.Add(RegisterStep.Create(stepId, typeof(T), description, _ => behavior)); }
/// <summary> /// Register a new step into the pipeline. /// </summary> /// <param name="stepId">The identifier of the new step to add.</param> /// <param name="factoryMethod">A callback that creates the behavior instance.</param> /// <param name="description">The description of the behavior.</param> public void Register <T>(string stepId, Func <IBuilder, T> factoryMethod, string description) where T : IBehavior { BehaviorTypeChecker.ThrowIfInvalid(typeof(T), "behavior"); Guard.AgainstNullAndEmpty(nameof(stepId), stepId); Guard.AgainstNullAndEmpty(nameof(description), description); modifications.Additions.Add(RegisterStep.Create(stepId, typeof(T), description, b => factoryMethod(b))); }
/// <summary> /// Register a new step into the pipeline. /// </summary> /// <param name="stepId">The identifier of the new step to add.</param> /// <param name="behavior">The <see cref="IBehavior{TContext}"/> to execute.</param> /// <param name="description">The description of the behavior.</param> public void Register(string stepId, Type behavior, string description) { BehaviorTypeChecker.ThrowIfInvalid(behavior, "behavior"); if (string.IsNullOrEmpty(stepId)) { throw new ArgumentNullException("stepId"); } if (string.IsNullOrEmpty(description)) { throw new ArgumentNullException("description"); } config.Settings.Get <PipelineModifications>().Additions.Add(RegisterStep.Create(stepId, behavior, description)); }
public void Register(RegisterStep rego) { additions.Add(rego); }
public void Register(WellKnownStep wellKnownStep, Type behavior, string description) { additions.Add(RegisterStep.Create(wellKnownStep, behavior, description)); }
/// <summary> /// Register a new step into the pipeline. /// </summary> /// <param name="registration">The step registration.</param> public void Register(RegisterStep registration) { Guard.AgainstNull(nameof(registration), registration); modifications.Additions.Add(registration); }