public bool MatchInjectionConfigurationGroup(InjectionConfigurationGroup configGroup)
        {
            var description = configGroup.ObjectDescription;

            return(description.ConcreteType == _property.DeclaringType || // The property is defined in the ConcreteType directly
                   _property.DeclaringType.IsAssignableFrom(description.ConcreteType)); // The property is defined in the base type of ConcreteType
        }
        public InjectionConfigurationSet(ObjectDescription description, ObjectRelation admin, InjectionConfigurationGroup defaultGroup)
        {
            if (!defaultGroup.MatchInjectionConfigurationSet(this))
            {
                throw new InvalidOperationException();
            }

            _description  = description;
            _admin        = admin;
            _defaultGroup = defaultGroup;
        }
        public void AddCustomInjectionConfigurationGroup(InjectionConfigurationGroup group)
        {
            Requires.NotNull(group, "group");
            if (!group.MatchInjectionConfigurationSet(this))
            {
                return;
            }

            if (_customGroups == null)
            {
                _customGroups = new List <InjectionConfigurationGroup>();
            }
            _customGroups.Add(group);
        }
Exemple #4
0
        public bool MatchInjectionConfigurationGroup(InjectionConfigurationGroup configGroup)
        {
            var description = configGroup.ObjectDescription;

            return(description.ContractType.IsAssignableFrom(_constructor.DeclaringType));
        }