Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Adds the contents of the provided attributes to the table builder.
Namespace: Microsoft.Windows.Design.Metadata
Assembly: Microsoft.Windows.Design.Extensibility (in Microsoft.Windows.Design.Extensibility.dll)
Syntax
'Declaration
Public Sub AddCustomAttributes ( _
type As Type, _
ParamArray attributes As Attribute() _
)
public void AddCustomAttributes(
Type type,
params Attribute[] attributes
)
public:
void AddCustomAttributes(
Type^ type,
... array<Attribute^>^ attributes
)
member AddCustomAttributes :
type:Type *
attributes:Attribute[] -> unit
public function AddCustomAttributes(
type : Type,
... attributes : Attribute[]
)
Parameters
- type
Type: System.Type
The type to add class-level attributes to.
- attributes
Type: array<System.Attribute[]
The new attributes to add to type.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | type or attributes is nulla null reference (Nothing in Visual Basic). |
Remarks
Conflicts are resolved with a last-in-wins strategy. When building a large attribute table, use the AddCallback method to defer the work of creating attributes until they are needed.
Examples
The following code example shows how to add an attribute to a type. This code example is part of a larger example provided for the AttributeTableBuilder class.
builder.AddCustomAttributes( _
GetType(Button), _
New DefaultPropertyAttribute("Content"))
builder.AddCustomAttributes(
typeof(Button),
new DefaultPropertyAttribute("Content"));
.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.