public SpyExtension(BuilderStrategy strategy, UnityBuildStage stage, object policy, Type policyType) { this.strategy = strategy; this.stage = stage; this.policy = policy; this.policyType = policyType; }
/// <summary> /// Adds a strategy to the chain at a particular stage. /// </summary> /// <param name="strategy">The strategy to add to the chain.</param> /// <param name="stage">The stage to add the strategy.</param> public void Add(BuilderStrategy strategy, TStageEnum stage) { lock (_lockObject) { _stages[Convert.ToInt32(stage)].Add(strategy); } }
private static object BuildResolveLazy <T>(ref BuilderContext context) { var container = context.Container; var name = context.Name; context.Existing = new Lazy <T>(() => container.Resolve <T>(name)); var lifetime = BuilderStrategy.GetPolicy <LifetimeManager>(ref context); if (lifetime is PerResolveLifetimeManager) { var perBuildLifetime = new InternalPerResolveLifetimeManager(context.Existing); context.Set(typeof(LifetimeManager), perBuildLifetime); } return(context.Existing); }
/// <summary> /// Adds a strategy to the chain. /// </summary> /// <param name="strategy">The strategy to add to the chain.</param> public void Add(BuilderStrategy strategy) { _strategies.Add(strategy); }
public SpyExtension(BuilderStrategy strategy, UnityBuildStage stage) { this.strategy = strategy; this.stage = stage; }