ExtractCustomAttribute() private static method

private static ExtractCustomAttribute ( IList attributes, Type caType ) : Object[]
attributes IList
caType System.Type
return Object[]
Example #1
0
 internal static Object[] GetCustomAttributes(Module target, Type caType, bool inherit)
 {
     if (!target.Assembly.ReflectionOnly)
     {
         return(target.GetCustomAttributes(caType, inherit));
     }
     return(CustomAttribute.ExtractCustomAttribute(CustomAttributeData.GetCustomAttributes(target), caType));
 }
Example #2
0
        internal static Object[] GetCustomAttributes(ParameterInfo target, Type caType, bool inherit)
        {
            // JScript implements subclasses of ParameterInfo which throw an exception when Module is
            // accessed. We know that none of these are from a ReflectionOnly assembly.
            Type t = target.GetType();

            if (t.Assembly == typeof(CustomAttribute).Assembly || !target.Member.Module.Assembly.ReflectionOnly)
            {
                return(target.GetCustomAttributes(caType, inherit));
            }
            return(CustomAttribute.ExtractCustomAttribute(CustomAttributeData.GetCustomAttributes(target), caType));
        }