CodeStatementCollection.AddRange Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Adiciona um conjunto de CodeStatement objetos à coleção.
Sobrecargas
| Name | Description |
|---|---|
| AddRange(CodeStatement[]) |
Adiciona um conjunto de CodeStatement objetos à coleção. |
| AddRange(CodeStatementCollection) |
Adiciona o conteúdo de outro CodeStatementCollection objeto ao final da coleção. |
AddRange(CodeStatement[])
Adiciona um conjunto de CodeStatement objetos à coleção.
public:
void AddRange(cli::array <System::CodeDom::CodeStatement ^> ^ value);
public void AddRange(System.CodeDom.CodeStatement[] value);
member this.AddRange : System.CodeDom.CodeStatement[] -> unit
Public Sub AddRange (value As CodeStatement())
Parâmetros
- value
- CodeStatement[]
Um conjunto de CodeStatement objetos para adicionar à coleção.
Exceções
value é null.
Exemplos
O exemplo seguinte demonstra como usar a AddRange(CodeStatement[]) sobrecarga de métodos para adicionar os membros de um array a uma CodeStatementCollection instância.
// Adds an array of CodeStatement objects to the collection.
CodeStatement[] statements = {
new CodeCommentStatement("Test comment statement"),
new CodeCommentStatement("Test comment statement")};
collection.AddRange( statements );
// Adds a collection of CodeStatement objects to the collection.
CodeStatement testStatement = new CodeCommentStatement("Test comment statement");
CodeStatementCollection statementsCollection = new CodeStatementCollection();
statementsCollection.Add( new CodeCommentStatement("Test comment statement") );
statementsCollection.Add( new CodeCommentStatement("Test comment statement") );
statementsCollection.Add( testStatement );
collection.AddRange( statementsCollection );
' Adds an array of CodeStatement objects to the collection.
Dim statements As CodeStatement() = {New CodeCommentStatement("Test comment statement"), New CodeCommentStatement("Test comment statement")}
collection.AddRange(statements)
' Adds a collection of CodeStatement objects to the collection.
Dim testStatement As New CodeStatement
Dim statementsCollection As New CodeStatementCollection
statementsCollection.Add(New CodeCommentStatement("Test comment statement"))
statementsCollection.Add(New CodeCommentStatement("Test comment statement"))
statementsCollection.Add(testStatement)
collection.AddRange(statementsCollection)
Ver também
Aplica-se a
AddRange(CodeStatementCollection)
Adiciona o conteúdo de outro CodeStatementCollection objeto ao final da coleção.
public:
void AddRange(System::CodeDom::CodeStatementCollection ^ value);
public void AddRange(System.CodeDom.CodeStatementCollection value);
member this.AddRange : System.CodeDom.CodeStatementCollection -> unit
Public Sub AddRange (value As CodeStatementCollection)
Parâmetros
- value
- CodeStatementCollection
Um CodeStatementCollection objeto que contém os objetos a adicionar à coleção.
Exceções
value é null.
Exemplos
O exemplo seguinte demonstra como usar a AddRange(CodeStatementCollection) sobrecarga de métodos para adicionar os membros de um CodeStatementCollection ao outro.
// Adds an array of CodeStatement objects to the collection.
CodeStatement[] statements = {
new CodeCommentStatement("Test comment statement"),
new CodeCommentStatement("Test comment statement")};
collection.AddRange( statements );
// Adds a collection of CodeStatement objects to the collection.
CodeStatement testStatement = new CodeCommentStatement("Test comment statement");
CodeStatementCollection statementsCollection = new CodeStatementCollection();
statementsCollection.Add( new CodeCommentStatement("Test comment statement") );
statementsCollection.Add( new CodeCommentStatement("Test comment statement") );
statementsCollection.Add( testStatement );
collection.AddRange( statementsCollection );
' Adds an array of CodeStatement objects to the collection.
Dim statements As CodeStatement() = {New CodeCommentStatement("Test comment statement"), New CodeCommentStatement("Test comment statement")}
collection.AddRange(statements)
' Adds a collection of CodeStatement objects to the collection.
Dim testStatement As New CodeStatement
Dim statementsCollection As New CodeStatementCollection
statementsCollection.Add(New CodeCommentStatement("Test comment statement"))
statementsCollection.Add(New CodeCommentStatement("Test comment statement"))
statementsCollection.Add(testStatement)
collection.AddRange(statementsCollection)