/// <summary> /// ctor /// </summary> public Builder() { Strategies.AddNew <TypeMappingStrategy>(BuilderStage.PreCreation); Strategies.AddNew <CreationStrategy>(BuilderStage.Creation); Policies.SetDefault <ICreationPolicy>(new DefaultCreationPolicy()); }
/// <summary> /// Initializes a new instance of the <see cref="WCSFBuilder"/> class using the provided /// configurator. /// </summary> /// <param name="configurator">The configurator that will configure the builder.</param> public WCSFBuilder(IBuilderConfigurator <WCSFBuilderStage> configurator) { Strategies.AddNew <TypeMappingStrategy>(WCSFBuilderStage.PreCreation); Strategies.AddNew <SimplifiedSingletonStrategy>(WCSFBuilderStage.PreCreation); Strategies.AddNew <BuildPlanStrategy>(WCSFBuilderStage.Creation); Strategies.AddNew <BuilderAwareStrategy>(WCSFBuilderStage.PostInitialization); Policies.SetDefault <ICreationPolicy>(new DefaultCreationPolicy()); Policies.SetDefault <IBuildPlanPolicy>(new BuildPlanPolicy()); Policies.SetDefault <IPlanBuilderPolicy>(CreatePlanBuilder()); if (configurator != null) { configurator.ApplyConfiguration(this); } }
/// <summary> /// Initializes a new instance of the <see cref="Builder"/> class using the provided /// configurator. /// </summary> /// <param name="configurator">The configurator that will configure the builder.</param> public Builder(IBuilderConfigurator <BuilderStage> configurator) { Strategies.AddNew <TypeMappingStrategy>(BuilderStage.PreCreation); Strategies.AddNew <SingletonStrategy>(BuilderStage.PreCreation); Strategies.AddNew <ConstructorReflectionStrategy>(BuilderStage.PreCreation); Strategies.AddNew <PropertyReflectionStrategy>(BuilderStage.PreCreation); Strategies.AddNew <MethodReflectionStrategy>(BuilderStage.PreCreation); Strategies.AddNew <CreationStrategy>(BuilderStage.Creation); Strategies.AddNew <PropertySetterStrategy>(BuilderStage.Initialization); Strategies.AddNew <MethodExecutionStrategy>(BuilderStage.Initialization); Strategies.AddNew <BuilderAwareStrategy>(BuilderStage.PostInitialization); Policies.SetDefault <ICreationPolicy>(new DefaultCreationPolicy()); if (configurator != null) { configurator.ApplyConfiguration(this); } }