public static IList<CustomAttributeData> GetCustomAttributes(ParameterInfo target)
{
if (target == null)
throw new ArgumentNullException("target");
IList<CustomAttributeData> cad = GetCustomAttributes(target.Member.Module, target.MetadataToken);
int pcaCount = 0;
Attribute[] a = PseudoCustomAttribute.GetCustomAttributes((ParameterInfo)target, typeof(object), out pcaCount);
if (pcaCount == 0)
return cad;
CustomAttributeData[] pca = new CustomAttributeData[cad.Count + pcaCount];
cad.CopyTo(pca, pcaCount);
for (int i = 0; i < pcaCount; i++)
pca[i] = new CustomAttributeData(a[i]);
return Array.AsReadOnly(pca);
}
#endregion