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)