Sdílet prostřednictvím


AttributeTableBuilder.AddCustomAttributes – metoda (Type, array<Attribute )

Přidá obsah poskytnutý atributy tabulky Tvůrce.

Obor názvů:  Microsoft.Windows.Design.Metadata
Sestavení:  Microsoft.Windows.Design.Extensibility (v Microsoft.Windows.Design.Extensibility.dll)

Syntaxe

'Deklarace
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[]
)

Parametry

  • type
    Typ: System.Type
    Typ přidání atributů do úrovně třídy.

Výjimky

Výjimka Podmínka
ArgumentNullException

typeor attributes is nullodkaz Null (Nothing v jazyce Visual Basic).

Poznámky

Konflikty vyřešeny s poslední v wins strategie. Při vytváření tabulky velké atribut použít AddCallback metody práce vytváření atributy, dokud jsou potřeba odložit.

Příklady

Následující příklad kódu ukazuje, jak přidat atribut typu. Příklad kódu je součástí větší příklad stanovené AttributeTableBuilder Třída

builder.AddCustomAttributes( _
    GetType(Button), _
    New DefaultPropertyAttribute("Content"))
builder.AddCustomAttributes(
    typeof(Button),
    new DefaultPropertyAttribute("Content"));

Zabezpečení rozhraní .NET Framework

Viz také

Odkaz

AttributeTableBuilder Třída

AddCustomAttributes – přetížení

Microsoft.Windows.Design.Metadata – obor názvů

AttributeTable

AttributeCallbackBuilder