Exemplo n.º 1
0
        private void PopResolutionContext(ResolutionContext.ResolutionContextActivation activation,
                                          ContainerService containerService, bool isEnumerable)
        {
            ResolutionContext.Pop(activation);
            if (activation.previous == null)
            {
                return;
            }
            var resultDependency = containerService.AsDependency(containerContext, "() => " + containerService.Type.FormatName(), isEnumerable);

            if (activation.activated.Container != activation.previous.Container)
            {
                resultDependency.Comment = "container boundary";
            }
            activation.previous.TopBuilder.AddDependency(resultDependency, false);
        }
Exemplo n.º 2
0
            public void LinkTo(ContainerContext containerContext, ContainerService childService, string comment)
            {
                var dependency = childService.AsDependency(containerContext, null, true);

                dependency.Comment = comment;
                AddDependency(dependency, true);
                UnionUsedContracts(childService);
                if (target.Status.IsGood())
                {
                    foreach (var instance in childService.Instances)
                    {
                        if (!instances.Contains(instance))
                        {
                            AddInstance(instance);
                        }
                    }
                }
            }
Exemplo n.º 3
0
 private void PopResolutionContext(ResolutionContext.ResolutionContextActivation activation,
     ContainerService containerService, bool isEnumerable)
 {
     ResolutionContext.Pop(activation);
     if (activation.previous == null)
         return;
     var resultDependency = containerService.AsDependency(containerContext, "() => " + containerService.Type.FormatName(),isEnumerable);
     if (activation.activated.Container != activation.previous.Container)
         resultDependency.Comment = "container boundary";
     activation.previous.TopBuilder.AddDependency(resultDependency, false);
 }