示例#1
0
        public InternalFactoryBuilder Register(RuntimeTypeHandle typeHandle, string keyName, Type registerType)
        {
            InternalFactory newInternalFactory = new InternalFactory();

            newInternalFactory.Activator = new ReflectionActivator(registerType);

            this.InternalFactorys.Add(new Identity(typeHandle, keyName), newInternalFactory);

            return(new InternalFactoryBuilder(newInternalFactory));
        }
示例#2
0
        public InternalFactoryBuilder Register(Type type, object instance)
        {
            InternalFactory newInternalFactory = new InternalFactory();

            newInternalFactory.Activator = new InstanceActivator(instance);
            newInternalFactory.Lifecycle = new SingletonLifecycle();

            this.InternalFactorys.Add(new Identity(type.TypeHandle, type.FullName), newInternalFactory);

            return(new InternalFactoryBuilder(newInternalFactory));
        }
示例#3
0
 public ParameterInjector(IContainer container, InternalFactory internalFactory)
 {
     this.Container       = container;
     this.InternalFactory = internalFactory;
 }
示例#4
0
        public InternalFactoryBuilder Register(Type registerType, InternalFactory newInternalFactory)
        {
            this.InternalFactorys.Add(new Identity(registerType.TypeHandle, registerType.FullName), newInternalFactory);

            return(new InternalFactoryBuilder(newInternalFactory));
        }
示例#5
0
 public InternalFactoryBuilder(InternalFactory internalFactory)
 {
     this.InternalFactory = internalFactory;
 }