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

GetCustomAttribute() public static method

public static GetCustomAttribute ( Assembly element, Type attributeType, bool inherit ) : Attribute
element System.Reflection.Assembly
attributeType Type
inherit bool
return Attribute
		public static Attribute GetCustomAttribute (Assembly element, Type attributeType, bool inherit)
		{
			// neither parameter is allowed to be null
			CheckParameters (element, attributeType);

			// Assembly inheritance hierarchies CAN NOT be searched for attributes, so the second
			// parameter of GetCustomAttributes () is IGNORED.
			object[] attributes = element.GetCustomAttributes (attributeType, inherit);

			return FindAttribute (attributes);
		}

Same methods

Attribute.Attribute::GetCustomAttribute ( Assembly element, Type attributeType ) : Attribute
Attribute.Attribute::GetCustomAttribute ( MemberInfo element, Type attributeType ) : Attribute
Attribute.Attribute::GetCustomAttribute ( MemberInfo element, Type attributeType, bool inherit ) : Attribute
Attribute.Attribute::GetCustomAttribute ( Module element, Type attributeType ) : Attribute
Attribute.Attribute::GetCustomAttribute ( Module element, Type attributeType, bool inherit ) : Attribute
Attribute.Attribute::GetCustomAttribute ( ParameterInfo element, Type attributeType ) : Attribute
Attribute.Attribute::GetCustomAttribute ( ParameterInfo element, Type attributeType, bool inherit ) : Attribute