CodeCatchClauseCollection.AddRange Метод

Определение

Копирует элементы указанного CodeCatchClause массива в конец коллекции.

Перегрузки

Имя Описание
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 , содержащий объекты, добавляемые в коллекцию.

Исключения

value равно null.

Примеры

В следующем примере показано, как использовать 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 , содержащий объекты, добавляемые в коллекцию.

Исключения

value равно null.

Примеры

В следующем примере показано, как использовать перегрузку 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)

См. также раздел

Применяется к