System.Attribute.Attribute.GetCustomAttributes C# (CSharp) Method

GetCustomAttributes() public static method

public static GetCustomAttributes ( MemberInfo element, Type type, bool inherit ) : System.Attribute[]
element System.Reflection.MemberInfo
type Type
inherit bool
return System.Attribute[]
		public static Attribute[] GetCustomAttributes (MemberInfo element, Type type, bool inherit)
		{
			// element parameter is not allowed to be null
			CheckParameters (element, type);

			// MS ignores the inherit param in PropertyInfo's ICustomAttributeProvider 
			// implementation, but not in the Attributes, so directly get the attributes
			// from MonoCustomAttrs instead of going throught the PropertyInfo's 
			// ICustomAttributeProvider
			MemberTypes mtype = element.MemberType;
			if (mtype == MemberTypes.Property)
				return (Attribute []) MonoCustomAttrs.GetCustomAttributes (element, type, inherit);
			return (Attribute []) element.GetCustomAttributes (type, inherit);
		}

Same methods

Attribute.Attribute::GetCustomAttributes ( Assembly element ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( Assembly element, Type attributeType ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( Assembly element, Type attributeType, bool inherit ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( Assembly element, bool inherit ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( MemberInfo element ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( MemberInfo element, Type type ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( MemberInfo element, bool inherit ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( Module element ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( Module element, Type attributeType ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( Module element, Type attributeType, bool inherit ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( Module element, bool inherit ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( ParameterInfo element ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( ParameterInfo element, Type attributeType ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( ParameterInfo element, Type attributeType, bool inherit ) : System.Attribute[]
Attribute.Attribute::GetCustomAttributes ( ParameterInfo element, bool inherit ) : System.Attribute[]