CodeStatementCollection.AddRange メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
CodeStatement オブジェクトのセットをコレクションに追加します。
オーバーロード
| 名前 | 説明 |
|---|---|
| AddRange(CodeStatement[]) |
CodeStatement オブジェクトのセットをコレクションに追加します。 |
| AddRange(CodeStatementCollection) |
別の CodeStatementCollection オブジェクトの内容をコレクションの末尾に追加します。 |
AddRange(CodeStatement[])
CodeStatement オブジェクトのセットをコレクションに追加します。
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())
パラメーター
- value
- CodeStatement[]
コレクションに追加 CodeStatement オブジェクトの配列。
例外
value は nullです。
例
次の例では、 AddRange(CodeStatement[]) メソッドのオーバーロードを使用して、配列のメンバーを CodeStatementCollection インスタンスに追加する方法を示します。
// 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)
こちらもご覧ください
適用対象
AddRange(CodeStatementCollection)
別の CodeStatementCollection オブジェクトの内容をコレクションの末尾に追加します。
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)
パラメーター
- value
- CodeStatementCollection
コレクションに追加するオブジェクトを含む CodeStatementCollection オブジェクト。
例外
value は nullです。
例
次の例では、 AddRange(CodeStatementCollection) メソッドのオーバーロードを使用して、1 つの CodeStatementCollection のメンバーを別のに追加する方法を示します。
// 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)