Пример #1
0
        public void Register <TInterface, TClass>(LifeCycleTypes lifeCycleType = LifeCycleTypes.TRANSIENT) where TClass : TInterface
        {
            RegistryEntry entry;

            Registry.TryGetValue(typeof(TInterface), out entry);
            if (entry != null)
            {
                throw new Exception("Interface: " + typeof(TInterface) + " is already registered.");
            }
            else
            {
                entry = new RegistryEntry(typeof(TClass), lifeCycleType);
                Registry[typeof(TInterface)] = entry;
            }
        }
Пример #2
0
 public RegistryEntry(Type classType, LifeCycleTypes lifeCycleType)
 {
     Class         = classType;
     LifeCycleType = lifeCycleType;
 }
Пример #3
0
 public RegistryEntry(Type classType, LifeCycleTypes lifeCycleType)
 {
     Class = classType;
     LifeCycleType = lifeCycleType;
 }