internal static object[] GetCustomAttributes(MemberInfo info) { object[] attributes = (object[])attributeCache[info]; if (attributes == null) { attributes = info.GetCustomAttributes(false); lock(attributeCache) { attributeCache[info] = attributes; } } return attributes; }