Ejemplo n.º 1
0
        private void CreateFactory(ComponentRegistration key, Delegate @delegate, InstanceMode instanceMode)
        {
            IFactoryProvider factoryProvider = null;

            if (instanceMode == InstanceMode.Transient)
            {
                factoryProvider = new TransientFactory(@delegate);
            }

            if (instanceMode == InstanceMode.Singleton)
            {
                factoryProvider = new SingletonFactory(@delegate);
            }

            lock (syncLock)
            {
                components[key] = factoryProvider;
            }
        }
Ejemplo n.º 2
0
 public Component ServiceFor <TInt, TCOMP>()
 {
     componentRegistration = new ComponentRegistration(typeof(TInt), typeof(TCOMP));
     return(this);
 }
Ejemplo n.º 3
0
 public Component For <TCOMP>()
 {
     componentRegistration = new ComponentRegistration(typeof(TCOMP));
     return(this);
 }