예제 #1
0
        public Type GetValidatedType(Type collectorType)
        {
            ArgumentUtility.CheckNotNull("collectorType", collectorType);

            if (collectorType.IsDefined(typeof(ApplyWithMixinAttribute), false))
            {
                return(AttributeUtility.GetCustomAttribute <ApplyWithMixinAttribute> (collectorType, false).MixinType);
            }
            return(_validatedTypeResolver.GetValidatedType(collectorType));
        }
예제 #2
0
        private Type GetValidatedType(Type collectorType)
        {
            var type = _validatedTypeResolver.GetValidatedType(collectorType);

            if (type == null)
            {
                throw new InvalidOperationException(string.Format("No validated type could be resolved for collector '{0}'.", collectorType.FullName));
            }
            return(type);
        }
예제 #3
0
        public Type GetValidatedType(Type collectorType)
        {
            ArgumentUtility.CheckNotNull("collectorType", collectorType);

            if (TypeExtensions.CanAscribeTo(collectorType, typeof(IComponentValidationCollector <>)))
            {
                return(TypeExtensions.GetAscribedGenericArguments(collectorType, typeof(IComponentValidationCollector <>)).Single());
            }
            return(_validatedTypeResolver.GetValidatedType(collectorType));
        }