CodeAttributeArgumentCollection.Add(CodeAttributeArgument) 方法

定義

將指定的 CodeAttributeArgument 物件加入集合中。

public:
 int Add(System::CodeDom::CodeAttributeArgument ^ value);
public int Add(System.CodeDom.CodeAttributeArgument value);
member this.Add : System.CodeDom.CodeAttributeArgument -> int
Public Function Add (value As CodeAttributeArgument) As Integer

參數

value
CodeAttributeArgument

CodeAttributeArgument要補充的目標。

傳回

新元素插入的索引。

範例

以下範例示範如何將物件加入CodeAttributeArgumentCodeAttributeArgumentCollection實例。

// Adds a CodeAttributeArgument to the collection.
collection.Add( new CodeAttributeArgument("Test Boolean Argument", new CodePrimitiveExpression(true)) );
' Adds a CodeAttributeArgument to the collection.
collection.Add(New CodeAttributeArgument("Test Boolean Argument", New CodePrimitiveExpression(True)))

適用於

另請參閱