Skip to content

M_CodeJam_Metadata_XmlAttributeReader_GetAttributes__1_1

Andrew Koryavchenko edited this page Jun 17, 2018 · 3 revisions

XmlAttributeReader.GetAttributes(T) Method (Type, Boolean)

Returns custom attributes applied to provided type.

Namespace: CodeJam.Metadata
Assembly: CodeJam.Blocks (in CodeJam.Blocks.dll) Version: 2.0.0.0

Syntax

C#

public T[] GetAttributes<T>(
	Type type,
	bool inherit = true
)
where T : Attribute

VB

Public Function GetAttributes(Of T As Attribute) ( 
	type As Type,
	Optional inherit As Boolean = true
) As T()

F#

abstract GetAttributes : 
        type : Type * 
        ?inherit : bool 
(* Defaults:
        let _inherit = defaultArg inherit true
*)
-> 'T[]  when 'T : Attribute
override GetAttributes : 
        type : Type * 
        ?inherit : bool 
(* Defaults:
        let _inherit = defaultArg inherit true
*)
-> 'T[]  when 'T : Attribute

Parameters

 

type
Type: System.Type
Object type
inherit (Optional)
Type: System.Boolean
true to search this member's inheritance chain to find the attributes; otherwise, false.

Type Parameters

 

T
The type of attribute to search for. Only attributes that are assignable to this type are returned.

Return Value

Type: T[]
Array of custom attributes.

Implements

IMetadataReader.GetAttributes(T)(Type, Boolean)

See Also

Reference

XmlAttributeReader Class
GetAttributes Overload
CodeJam.Metadata Namespace

Clone this wiki locally