public ConstructorFrame(ConstructorInstance instance, DisposeTracking disposal, Variable[] arguments) { Disposal = disposal; _arguments = arguments; Variable = new ServiceVariable(instance, this); _implementationType = instance.ImplementationType; }
public MessagingRootFrame(MessagingRootInstance <T> parent, Variable root) { _parent = parent; _root = root; uses.Add(root); Service = new ServiceVariable(parent, this); }
public void service_variable_exposes_the_nested_container_as_a_parent() { var variable = new ServiceVariable(typeof(ScopedService), StructureMapServices.Nested); variable.Dependencies.Single() .ShouldBeSameAs(StructureMapServices.Nested); }
public InstanceConstructorFrame(ConstructorInstance instance, DisposeTracking disposal, Variable[] arguments, SetterArg[] setterParameters) : base(instance.ImplementationType, instance.Constructor) { Variable = new ServiceVariable(instance, this, ServiceDeclaration.ServiceType); Disposal = disposal; Parameters = arguments; switch (disposal) { case DisposeTracking.None: Mode = ConstructorCallMode.Variable; break; case DisposeTracking.WithUsing: Mode = ConstructorCallMode.UsingNestedVariable; break; case DisposeTracking.RegisterWithScope: Mode = ConstructorCallMode.Variable; var addDisposable = MethodCall.For <Scope>(s => s.TryAddDisposable(null)); addDisposable.Arguments[0] = Variable; ActivatorFrames.Add(addDisposable); break; } Setters.AddRange(setterParameters); }
public CallFuncBuilderFrame(ConstructorInstance instance, DisposeTracking disposal, Variable func, Variable[] arguments) { Disposal = disposal; _func = func; _arguments = arguments; Variable = new ServiceVariable(instance, this); }
public CallFuncBuilderFrame(ConstructorInstance instance, DisposeTracking disposal, Variable func, Variable[] arguments) { // HACK, and I hate this but it's necessary. for (int i = 0; i < arguments.Length; i++) { if (arguments[i] is OptionalArgumentVariable) { arguments[i] = ((OptionalArgumentVariable)arguments[i]).Inner; } } Disposal = disposal; _func = func; _arguments = arguments; Variable = new ServiceVariable(instance, this); }
public GetFuncFrame(Instance instance, Type innerType) { _serviceType = innerType; Variable = new ServiceVariable(instance, this); }
public SqlConnectionFrame(Variable settings, Instance instance) { _settings = settings; Connection = new ServiceVariable(instance, this); _instance = instance; }
public InlineLambdaCreationFrame(Setter setter, Instance instance) { Variable = new ServiceVariable(instance, this); _setter = setter; }
public OpenSessionFrame(SessionInstance instance, Variable store) { Variable = new ServiceVariable(instance, this); uses.Add(store); }
public GetInjectedServiceFrame(InjectedInstance <T> parent) { Variable = new ServiceVariable(parent, this); }
public NewContextFrame(MessageContextInstance instance, Variable root) { _root = root; Variable = new ServiceVariable(instance, this); uses.Add(root); }