Esempio 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;
            }
        }
Esempio n. 2
0
 public Component ServiceFor <TInt, TCOMP>()
 {
     componentRegistration = new ComponentRegistration(typeof(TInt), typeof(TCOMP));
     return(this);
 }
Esempio n. 3
0
 public Component For <TCOMP>()
 {
     componentRegistration = new ComponentRegistration(typeof(TCOMP));
     return(this);
 }