共用方式為


AttributeCallbackBuilder.AddCustomAttributes 方法 (array<Attribute )

會將指定之屬性的內容加入至這個產生器。

命名空間:  Microsoft.Windows.Design.Metadata
組件:  Microsoft.Windows.Design.Extensibility (在 Microsoft.Windows.Design.Extensibility.dll 中)

語法

'宣告
Public Sub AddCustomAttributes ( _
    ParamArray attributes As Attribute() _
)
public void AddCustomAttributes(
    params Attribute[] attributes
)
public:
void AddCustomAttributes(
    ... array<Attribute^>^ attributes
)
member AddCustomAttributes : 
        attributes:Attribute[] -> unit 
public function AddCustomAttributes(
    ... attributes : Attribute[]
)

參數

  • attributes
    型別:array<System.Attribute[]
    要加入的新屬性之陣列。

例外狀況

例外狀況 條件
ArgumentNullException

attributes 為 nullNull 參照 (即 Visual Basic 中的 Nothing)。

備註

以「後進寫入」(Last-in-Wins) 的策略解決衝突。

範例

在下列程式碼範例中,會說明如何使用 AttributeCallbackBuilder 類別,將屬性加入至型別。 這個程式碼範例是 AttributeCallbackBuilder 類別完整範例的一部分。

callbackBuilder.AddCustomAttributes(
    new DefaultPropertyAttribute("Content"));

.NET Framework 安全性

請參閱

參考

AttributeCallbackBuilder 類別

AddCustomAttributes 多載

Microsoft.Windows.Design.Metadata 命名空間

AttributeTableBuilder

AddCallback

AttributeTable