/// <summary>
        /// Constructor to modify the applied registrator
        /// </summary>
        /// <param name="registrator">Registrator replacement</param>
        internal CastleContainer(ComponentRegistrator registrator)
        {
            // Boot up the container and give it to the registrator
            Container   = registrator.Container = new WindsorContainer();
            Registrator = registrator;

            Container.AddFacility <TypedFactoryFacility>();
            Container.AddFacility <MoryxFacility>();

            // Self registration for framework functionality
            SetInstance <IContainer>(this);
        }
        private bool TypeRequired(Type foundType)
        {
            // Check if interface was specified as required
            if (foundType.IsInterface && _depReg.RequiredTypes.Contains(foundType))
            {
                return(true);
            }

            // Check if class exports required type
            if (foundType.IsClass && _depReg.RequiredTypes.Intersect(ComponentRegistrator.GetComponentServices(foundType)).Any())
            {
                return(true);
            }

            return(false);
        }