Пример #1
0
 public RegisteredComponent(IIoCContainer iocContainerParent, Type componentType, RegisteredParameters parameters)
     : this()
 {
     _iocContainerParent    = iocContainerParent;
     _componentType         = componentType;
     _constructorParameters = parameters;
 }
Пример #2
0
        public void RegisterComponent <ComponentType>(params RegisteredParameter[] parameters)
        {
            Type componentType = typeof(ComponentType);

            RegisteredParameters registeredParameters = new RegisteredParameters(parameters);
            RegisteredComponent  registeredComponent  = new RegisteredComponent(this, componentType, registeredParameters);

            _registeredComponents.Add(componentType, registeredComponent);
        }
Пример #3
0
        public void RegisterComponent <ComponentAbstractType, ComponentConcreteType>(params RegisteredParameter[] parameters)
        {
            Type abstractType = typeof(ComponentAbstractType);
            Type concreteType = typeof(ComponentConcreteType);

            if (concreteType.IsAbstract || concreteType.IsInterface)
            {
                throw new NotSupportedException("The provided type is not a concrete type.");
            }

            RegisteredParameters registeredParameters = new RegisteredParameters(parameters);
            RegisteredComponent  registeredComponent  = new RegisteredComponent(this, concreteType, registeredParameters);

            _registeredComponents.Add(abstractType, registeredComponent);
        }