Exemplo n.º 1
0
 private DryIocObjectFactory(
     DryIocObjectFactory parentFactory,
     IAspectComposer aspects,
     Action cleanup)
     : this(parentFactory.CurrentScope, aspects)
 {
     this.ParentFactory = parentFactory;
     this.Cleanup       = cleanup;
 }
Exemplo n.º 2
0
 private DryIocObjectFactory(
     DryIocObjectFactory parentFactory,
     IAspectComposer aspects,
     Action cleanup)
     : this(parentFactory.CurrentScope, aspects)
 {
     this.ParentFactory = parentFactory;
     this.Cleanup = cleanup;
 }
Exemplo n.º 3
0
 public IObjectFactory CreateScope(string id)
 {
     BuildScopeIfRequired();
     var innerComposer = Aspects.CreateInnerComposer();
     DryIocObjectFactory tv;
     Action cleanup = string.IsNullOrEmpty(id) ? (Action)null : () => TaggedScopes.TryRemove(id, out tv);
     var factory = new DryIocObjectFactory(this, innerComposer, cleanup);
     factory.RegisterInstance<IObjectFactory>(factory);
     factory.RegisterInterfaces(innerComposer);
     if (!string.IsNullOrEmpty(id))
         TaggedScopes.TryAdd(id, factory);
     return factory;
 }
Exemplo n.º 4
0
        public IObjectFactory CreateScope(string id)
        {
            BuildScopeIfRequired();
            var innerComposer = Aspects.CreateInnerComposer();
            DryIocObjectFactory tv;
            Action cleanup = string.IsNullOrEmpty(id) ? (Action)null : () => TaggedScopes.TryRemove(id, out tv);
            var    factory = new DryIocObjectFactory(this, innerComposer, cleanup);

            factory.RegisterInstance <IObjectFactory>(factory);
            factory.RegisterInterfaces(innerComposer);
            if (!string.IsNullOrEmpty(id))
            {
                TaggedScopes.TryAdd(id, factory);
            }
            return(factory);
        }