CodeTypeParameter.CustomAttributes Property


Gets the custom attributes of the type parameter.

Namespace:   System.CodeDom
Assembly:  System (in System.dll)

Public ReadOnly Property CustomAttributes As CodeAttributeDeclarationCollection

Property Value

Type: System.CodeDom.CodeAttributeDeclarationCollection

A CodeAttributeDeclarationCollection that indicates the custom attributes of the type parameter. The default is null.

This property can be used to add metadata attributes to the declaration of the type parameter.


This property is null by default and should be checked before referencing.

The following code example shows the use of the CustomAttributes property to add a new custom attribute. This example is part of a larger example provided for the CodeTypeParameter class.

kType.CustomAttributes.Add _
    (New CodeAttributeDeclaration("System.ComponentModel.DescriptionAttribute", _
        New CodeAttributeArgument(New CodePrimitiveExpression("KeyType"))))

.NET Framework
Available since 2.0
Return to top