AttributeTableContainer.GetAttributes Method (MemberInfo, Type)
Enumerates custom attributes for the specified member, including inherited attributes from base members.
Namespace: Microsoft.Windows.Design.Metadata
Assembly: Microsoft.Windows.Design.Extensibility (in Microsoft.Windows.Design.Extensibility.dll)
Syntax
'Declaration
Public Function GetAttributes ( _
member As MemberInfo, _
attributeType As Type _
) As IEnumerable(Of Object)
public IEnumerable<Object> GetAttributes(
MemberInfo member,
Type attributeType
)
public:
IEnumerable<Object^>^ GetAttributes(
MemberInfo^ member,
Type^ attributeType
)
member GetAttributes :
member:MemberInfo *
attributeType:Type -> IEnumerable<Object>
public function GetAttributes(
member : MemberInfo,
attributeType : Type
) : IEnumerable<Object>
Parameters
- member
Type: System.Reflection.MemberInfo
The member to get attributes for.
- attributeType
Type: System.Type
The attribute type to retrieve, or nulla null reference (Nothing in Visual Basic) for all attributes.
Return Value
Type: System.Collections.Generic.IEnumerable<Object>
An enumeration of attributes.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | member is nulla null reference (Nothing in Visual Basic). |
Remarks
The attributes returned are merged with attributes of other members and vary depending on member type.
For properties, the returned attributes are also merged with the attributes of the property type.
For events, the returned attributes are merged with the attributes of the event handler type.
For types, the returned attributes are merged with the attributes of interfaces implemented on the type.
If you do not want this automatic merging behavior, use the GetLocalAttributes method instead.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.