AttributeTableBuilder.AddCustomAttributes – metoda (Type, String, array<Attribute )
Přidá atributy členů se zadaným názvem.
Obor názvů: Microsoft.Windows.Design.Metadata
Sestavení: Microsoft.Windows.Design.Extensibility (v Microsoft.Windows.Design.Extensibility.dll)
Syntaxe
'Deklarace
Public Sub AddCustomAttributes ( _
ownerType As Type, _
memberName As String, _
ParamArray attributes As Attribute() _
)
public void AddCustomAttributes(
Type ownerType,
string memberName,
params Attribute[] attributes
)
public:
void AddCustomAttributes(
Type^ ownerType,
String^ memberName,
... array<Attribute^>^ attributes
)
member AddCustomAttributes :
ownerType:Type *
memberName:string *
attributes:Attribute[] -> unit
public function AddCustomAttributes(
ownerType : Type,
memberName : String,
... attributes : Attribute[]
)
Parametry
- ownerType
Typ: System.Type
Vlastnící typ členu.
- memberName
Typ: System.String
Člen přidat atributy.
- attributes
Typ: array<System.Attribute[]
Přidat atributy.
Výjimky
Výjimka | Podmínka |
---|---|
ArgumentNullException | ownerType, memberName, or attributes is nullodkaz Null (Nothing v jazyce Visual Basic). |
Poznámky
Člen může být vlastnost nebo událost. Člen je vyhodnocena na požádání atributy určenou vlastnost nebo událost dotazu uživatele. Jsou podporovány pouze členové vlastnost a událost. Všechny ostatní jsou ignorovány.
Příklady
Následující příklad kódu ukazuje, jak přidat atribut člena. Příklad kódu je součástí větší příklad stanovené AttributeTableBuilder Třída
' Apply the ReadOnlyAttribute to the Background property
' of the Button class.
builder.AddCustomAttributes( _
GetType(Button), _
"Background", _
New ReadOnlyAttribute(True))
// Apply the ReadOnlyAttribute to the Background property
// of the Button class.
builder.AddCustomAttributes(
typeof(Button),
"Background",
new ReadOnlyAttribute(true));
Zabezpečení rozhraní .NET Framework
- Plná důvěra přímému volajícímu. Částečně zabezpečený kód nemůže tento člen použít. Další informace naleznete v tématu Používání knihoven z částečně důvěryhodného kódu.
Viz také
Odkaz
AddCustomAttributes – přetížení