Exemplo n.º 1
0
        private IObjectAssemblySpecification RegisterOpenType(string name, Type tType, Type tImpl)
        {
            var entry = new ObjectAssemblySpecification(this, name, tType, tImpl);

            entry.WithInstanceCreationStrategy(DefaultInstanceCreationStrategy);
            _openTypeRegistry.Add(entry);
            return(entry);
        }
Exemplo n.º 2
0
        public IObjectAssemblySpecification Register(string name, Type type, Func <IAssembleObject, object> func)
        {
            if (func == null)
            {
                throw new ArgumentNullException("func");
            }

            var entry = new ObjectAssemblySpecification(this, name, type, func);

            entry.WithInstanceCreationStrategy(DefaultInstanceCreationStrategy);
            _typeRegistry.Add(entry);
            return(entry);
        }
        public void Add(ObjectAssemblySpecification reg)
        {
            IObjectAssemblerRegistrationKey key = MakeKey(reg.Name, reg.ResolvesTo);

            typeRegistrations[key] = reg;
        }