CodeCatchClauseCollection.AddRange 方法

定義

將指定 CodeCatchClause 陣列的元素複製到集合的末尾。

多載

名稱 Description
AddRange(CodeCatchClause[])

將指定 CodeCatchClause 陣列的元素複製到集合的末尾。

AddRange(CodeCatchClauseCollection)

將另一個 CodeCatchClauseCollection 物件的內容複製到集合的末尾。

AddRange(CodeCatchClause[])

來源:
CodeCatchClauseCollection.cs
來源:
CodeCatchClauseCollection.cs
來源:
CodeCatchClauseCollection.cs
來源:
CodeCatchClauseCollection.cs
來源:
CodeCatchClauseCollection.cs
來源:
CodeCatchClauseCollection.cs
來源:
CodeCatchClauseCollection.cs

將指定 CodeCatchClause 陣列的元素複製到集合的末尾。

public:
 void AddRange(cli::array <System::CodeDom::CodeCatchClause ^> ^ value);
public void AddRange(System.CodeDom.CodeCatchClause[] value);
member this.AddRange : System.CodeDom.CodeCatchClause[] -> unit
Public Sub AddRange (value As CodeCatchClause())

參數

value
CodeCatchClause[]

一個型別 CodeCatchClause 為 的陣列,包含要加入集合的物件。

例外狀況

valuenull

範例

以下範例示範如何利用 AddRange(CodeCatchClause[]) 方法過載將物件陣列 CodeCatchClause 的成員加入 CodeCatchClauseCollection

// Adds an array of CodeCatchClause objects to the collection.
CodeCatchClause[] clauses = { new CodeCatchClause(), new CodeCatchClause() };
collection.AddRange( clauses );

// Adds a collection of CodeCatchClause objects to the collection.
CodeCatchClauseCollection clausesCollection = new CodeCatchClauseCollection();
clausesCollection.Add( new CodeCatchClause("e", new CodeTypeReference(typeof(System.ArgumentOutOfRangeException))) );
clausesCollection.Add( new CodeCatchClause("e") );
collection.AddRange( clausesCollection );
' Adds an array of CodeCatchClause objects to the collection.
Dim clauses As CodeCatchClause() = {New CodeCatchClause(), New CodeCatchClause()}
collection.AddRange(clauses)

' Adds a collection of CodeCatchClause objects to the collection.
Dim clausesCollection As New CodeCatchClauseCollection()
clausesCollection.Add(New CodeCatchClause("e", New CodeTypeReference(GetType(System.ArgumentOutOfRangeException))))
clausesCollection.Add(New CodeCatchClause("e"))
collection.AddRange(clausesCollection)

另請參閱

適用於

AddRange(CodeCatchClauseCollection)

來源:
CodeCatchClauseCollection.cs
來源:
CodeCatchClauseCollection.cs
來源:
CodeCatchClauseCollection.cs
來源:
CodeCatchClauseCollection.cs
來源:
CodeCatchClauseCollection.cs
來源:
CodeCatchClauseCollection.cs
來源:
CodeCatchClauseCollection.cs

將另一個 CodeCatchClauseCollection 物件的內容複製到集合的末尾。

public:
 void AddRange(System::CodeDom::CodeCatchClauseCollection ^ value);
public void AddRange(System.CodeDom.CodeCatchClauseCollection value);
member this.AddRange : System.CodeDom.CodeCatchClauseCollection -> unit
Public Sub AddRange (value As CodeCatchClauseCollection)

參數

value
CodeCatchClauseCollection

CodeCatchClauseCollection A 包含要加入集合的物件。

例外狀況

valuenull

範例

以下範例示範如何利用 AddRange(CodeCatchClauseCollection) 方法過載將一個 CodeCatchClauseCollection 物件的成員加入另一個 CodeCatchClauseCollection物件。

// Adds an array of CodeCatchClause objects to the collection.
CodeCatchClause[] clauses = { new CodeCatchClause(), new CodeCatchClause() };
collection.AddRange( clauses );

// Adds a collection of CodeCatchClause objects to the collection.
CodeCatchClauseCollection clausesCollection = new CodeCatchClauseCollection();
clausesCollection.Add( new CodeCatchClause("e", new CodeTypeReference(typeof(System.ArgumentOutOfRangeException))) );
clausesCollection.Add( new CodeCatchClause("e") );
collection.AddRange( clausesCollection );
' Adds an array of CodeCatchClause objects to the collection.
Dim clauses As CodeCatchClause() = {New CodeCatchClause(), New CodeCatchClause()}
collection.AddRange(clauses)

' Adds a collection of CodeCatchClause objects to the collection.
Dim clausesCollection As New CodeCatchClauseCollection()
clausesCollection.Add(New CodeCatchClause("e", New CodeTypeReference(GetType(System.ArgumentOutOfRangeException))))
clausesCollection.Add(New CodeCatchClause("e"))
collection.AddRange(clausesCollection)

另請參閱

適用於