CodeParameterDeclarationExpressionCollection.AddRange 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將指定的陣列元素複製到集合末端。
多載
AddRange(CodeParameterDeclarationExpression[]) |
將指定的陣列元素複製到集合末端。 |
AddRange(CodeParameterDeclarationExpressionCollection) |
將另一個 CodeParameterDeclarationExpressionCollection 的內容加入至集合末端。 |
AddRange(CodeParameterDeclarationExpression[])
將指定的陣列元素複製到集合末端。
public:
void AddRange(cli::array <System::CodeDom::CodeParameterDeclarationExpression ^> ^ value);
public void AddRange (System.CodeDom.CodeParameterDeclarationExpression[] value);
member this.AddRange : System.CodeDom.CodeParameterDeclarationExpression[] -> unit
Public Sub AddRange (value As CodeParameterDeclarationExpression())
參數
CodeParameterDeclarationExpression 型別的陣列,包含要加入至集合的物件。
例外狀況
value
為 null
。
範例
下列範例示範如何使用 AddRange(CodeParameterDeclarationExpression[]) 方法多載,將陣列的成員 CodeParameterDeclarationExpression 加入至 CodeParameterDeclarationExpressionCollection。
// Adds an array of CodeParameterDeclarationExpression objects
// to the collection.
array<CodeParameterDeclarationExpression^>^parameters = {gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ),gcnew CodeParameterDeclarationExpression( bool::typeid,"testBoolArgument" )};
collection->AddRange( parameters );
// Adds a collection of CodeParameterDeclarationExpression objects
// to the collection.
CodeParameterDeclarationExpressionCollection^ parametersCollection = gcnew CodeParameterDeclarationExpressionCollection;
parametersCollection->Add( gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ) );
parametersCollection->Add( gcnew CodeParameterDeclarationExpression( bool::typeid,"testBoolArgument" ) );
collection->AddRange( parametersCollection );
// Adds an array of CodeParameterDeclarationExpression objects
// to the collection.
CodeParameterDeclarationExpression[] parameters = { new CodeParameterDeclarationExpression(typeof(int), "testIntArgument"), new CodeParameterDeclarationExpression(typeof(bool), "testBoolArgument") };
collection.AddRange( parameters );
// Adds a collection of CodeParameterDeclarationExpression objects
// to the collection.
CodeParameterDeclarationExpressionCollection parametersCollection = new CodeParameterDeclarationExpressionCollection();
parametersCollection.Add( new CodeParameterDeclarationExpression(typeof(int), "testIntArgument") );
parametersCollection.Add( new CodeParameterDeclarationExpression(typeof(bool), "testBoolArgument") );
collection.AddRange( parametersCollection );
' Adds an array of CodeParameterDeclarationExpression objects
' to the collection.
Dim parameters As CodeParameterDeclarationExpression() = {New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument"), New CodeParameterDeclarationExpression(GetType(Boolean), "testBoolArgument")}
collection.AddRange(parameters)
' Adds a collection of CodeParameterDeclarationExpression
' objects to the collection.
Dim parametersCollection As New CodeParameterDeclarationExpressionCollection()
parametersCollection.Add(New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument"))
parametersCollection.Add(New CodeParameterDeclarationExpression(GetType(Boolean), "testBoolArgument"))
collection.AddRange(parametersCollection)
另請參閱
適用於
AddRange(CodeParameterDeclarationExpressionCollection)
將另一個 CodeParameterDeclarationExpressionCollection 的內容加入至集合末端。
public:
void AddRange(System::CodeDom::CodeParameterDeclarationExpressionCollection ^ value);
public void AddRange (System.CodeDom.CodeParameterDeclarationExpressionCollection value);
member this.AddRange : System.CodeDom.CodeParameterDeclarationExpressionCollection -> unit
Public Sub AddRange (value As CodeParameterDeclarationExpressionCollection)
參數
CodeParameterDeclarationExpressionCollection,含有要加入至集合的物件。
例外狀況
value
為 null
。
範例
下列範例示範如何使用 AddRange(CodeParameterDeclarationExpressionCollection) 方法多載,將某個對象的成員新增至另一個 CodeParameterDeclarationExpressionCollectionCodeParameterDeclarationExpressionCollection。
// Adds an array of CodeParameterDeclarationExpression objects
// to the collection.
array<CodeParameterDeclarationExpression^>^parameters = {gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ),gcnew CodeParameterDeclarationExpression( bool::typeid,"testBoolArgument" )};
collection->AddRange( parameters );
// Adds a collection of CodeParameterDeclarationExpression objects
// to the collection.
CodeParameterDeclarationExpressionCollection^ parametersCollection = gcnew CodeParameterDeclarationExpressionCollection;
parametersCollection->Add( gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ) );
parametersCollection->Add( gcnew CodeParameterDeclarationExpression( bool::typeid,"testBoolArgument" ) );
collection->AddRange( parametersCollection );
// Adds an array of CodeParameterDeclarationExpression objects
// to the collection.
CodeParameterDeclarationExpression[] parameters = { new CodeParameterDeclarationExpression(typeof(int), "testIntArgument"), new CodeParameterDeclarationExpression(typeof(bool), "testBoolArgument") };
collection.AddRange( parameters );
// Adds a collection of CodeParameterDeclarationExpression objects
// to the collection.
CodeParameterDeclarationExpressionCollection parametersCollection = new CodeParameterDeclarationExpressionCollection();
parametersCollection.Add( new CodeParameterDeclarationExpression(typeof(int), "testIntArgument") );
parametersCollection.Add( new CodeParameterDeclarationExpression(typeof(bool), "testBoolArgument") );
collection.AddRange( parametersCollection );
' Adds an array of CodeParameterDeclarationExpression objects
' to the collection.
Dim parameters As CodeParameterDeclarationExpression() = {New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument"), New CodeParameterDeclarationExpression(GetType(Boolean), "testBoolArgument")}
collection.AddRange(parameters)
' Adds a collection of CodeParameterDeclarationExpression
' objects to the collection.
Dim parametersCollection As New CodeParameterDeclarationExpressionCollection()
parametersCollection.Add(New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument"))
parametersCollection.Add(New CodeParameterDeclarationExpression(GetType(Boolean), "testBoolArgument"))
collection.AddRange(parametersCollection)