MetalamaAPI documentationAspect APIMetalama.​Framework.​CodeICompilationGet­All­Attributes­Of­Type
Open sandboxFocus

ICompilation.GetAllAttributesOfType Method

GetAllAttributesOfType(INamedType, Boolean)

Gets all attributes of a given type in the current compilation, where the attribute type is given as an INamedType.

Declaration
IEnumerable<IAttribute> GetAllAttributesOfType(INamedType type, bool includeDerivedTypes = false)
Parameters
Type Name Description
INamedType type

The attribute type.

System.Boolean includeDerivedTypes

A value indicating whether attributes of types derived from type should be returned as well.

Returns
Type Description
System.Collections.Generic.IEnumerable<IAttribute>

A list of attributes.

GetAllAttributesOfType(Type, Boolean)

Gets all attributes of a given type in the current compilation, where the attribute type is given as a System.Type.

Declaration
IEnumerable<IAttribute> GetAllAttributesOfType(Type type, bool includeDerivedTypes = false)
Parameters
Type Name Description
System.Type type

The attribute type.

System.Boolean includeDerivedTypes

A value indicating whether attributes of types derived from type should be returned as well.

Returns
Type Description
System.Collections.Generic.IEnumerable<IAttribute>

A list of attributes.