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