CodeParameterDeclarationExpressionCollection.AddRange 方法

定义

将指定数组的元素复制到该集合的末尾。Copies the elements of the specified array to the end of the collection.

重载

AddRange(CodeParameterDeclarationExpression[])

将指定数组的元素复制到该集合的末尾。Copies the elements of the specified array to the end of the collection.

AddRange(CodeParameterDeclarationExpressionCollection)

将另一个 CodeParameterDeclarationExpressionCollection 的内容添加到集合末尾。Adds the contents of another CodeParameterDeclarationExpressionCollection to the end of the collection.

AddRange(CodeParameterDeclarationExpression[])

将指定数组的元素复制到该集合的末尾。Copies the elements of the specified array to the end of the collection.

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())

参数

value
CodeParameterDeclarationExpression[]

CodeParameterDeclarationExpression 类型的数组,包含要添加到集合的对象。An array of type CodeParameterDeclarationExpression containing the objects to add to the collection.

例外

valuenullvalue is null.

示例

下面的示例演示如何使用 AddRange(CodeParameterDeclarationExpression[]) 方法重载将数组的成员添加 CodeParameterDeclarationExpressionCodeParameterDeclarationExpressionCollectionThe following example demonstrates how to use the AddRange(CodeParameterDeclarationExpression[]) method overload to add the members of a CodeParameterDeclarationExpression array to a 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 的内容添加到集合末尾。Adds the contents of another CodeParameterDeclarationExpressionCollection to the end of the collection.

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)

参数

value
CodeParameterDeclarationExpressionCollection

CodeParameterDeclarationExpressionCollection,包含要添加到集合的对象。A CodeParameterDeclarationExpressionCollection containing the objects to add to the collection.

例外

valuenullvalue is null.

示例

下面的示例演示如何使用 AddRange(CodeParameterDeclarationExpressionCollection) 方法重载将一个对象的成员添加 CodeParameterDeclarationExpressionCollection 到另一个对象 CodeParameterDeclarationExpressionCollectionThe following example demonstrates how to use the AddRange(CodeParameterDeclarationExpressionCollection) method overload to add the members of one CodeParameterDeclarationExpressionCollection object to another 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)

另请参阅

适用于