ParserErrorCollection.AddRange Yöntem

Tanım

Bir koleksiyona nesne ekler ParserError .

Aşırı Yüklemeler

Name Description
AddRange(ParserError[])

Koleksiyona bir nesne dizisi ParserError ekler.

AddRange(ParserErrorCollection)

Mevcut ParserErrorCollection bir koleksiyondaki nesneleri koleksiyona ekler.

AddRange(ParserError[])

Koleksiyona bir nesne dizisi ParserError ekler.

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

Parametreler

value
ParserError[]

Koleksiyona eklenecek değerleri belirten tür ParserError dizisi.

Özel durumlar

value, null'e eşittir.

Örnekler

Aşağıdaki kod örneği, bir nesneye bir nesne ParserError aralığı ParserErrorCollection eklemeyi gösterir.

// Add an array of ParserError objects to the collection.
ParserError[] errors = 
    { new ParserError("Error 2", "Path", 1), 
    new ParserError("Error 3", "Path", 1) };
collection.AddRange(errors);

// Add a collection of ParserError objects to the collection.
ParserErrorCollection errorsCollection = new ParserErrorCollection();
errorsCollection.Add(new ParserError("Error", "Path", 1));
errorsCollection.Add(new ParserError("Error", "Path", 1));
collection.AddRange(errorsCollection);
' Add an array of ParserError objects to the collection.
Dim errors As ParserError() = _
    {New ParserError("Error 2", "Path", 1), _
    New ParserError("Error 3", "Path", 1)}
collection.AddRange(errors)

' Ads a collection of ParserError objects to the collection.
Dim errorsCollection As New ParserErrorCollection()
errorsCollection.Add(New ParserError("Error", "Path", 1))
errorsCollection.Add(New ParserError("Error", "Path", 1))
collection.AddRange(errorsCollection)

Açıklamalar

Koleksiyonuna AddRange bir nesne dizisi ParserError eklemek için yöntemini kullanın. yöntemi AddRange , birden çok ParserError nesne oluşturduğunuzda ve bunları tek bir yöntem çağrısıyla koleksiyona eklemek istediğinizde kullanışlıdır. Koleksiyona tek tek ParserError nesneler eklemek için yöntemini kullanın Add .

Şunlara uygulanır

AddRange(ParserErrorCollection)

Mevcut ParserErrorCollection bir koleksiyondaki nesneleri koleksiyona ekler.

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

Parametreler

value
ParserErrorCollection

ParserErrorCollection Koleksiyona ParserError eklenecek nesneleri içeren.

Özel durumlar

Örnekler

Aşağıdaki kod örneği, bir nesneye bir nesne ParserError aralığı ParserErrorCollection eklemeyi gösterir.

// Add an array of ParserError objects to the collection.
ParserError[] errors = 
    { new ParserError("Error 2", "Path", 1), 
    new ParserError("Error 3", "Path", 1) };
collection.AddRange(errors);

// Add a collection of ParserError objects to the collection.
ParserErrorCollection errorsCollection = new ParserErrorCollection();
errorsCollection.Add(new ParserError("Error", "Path", 1));
errorsCollection.Add(new ParserError("Error", "Path", 1));
collection.AddRange(errorsCollection);
' Add an array of ParserError objects to the collection.
Dim errors As ParserError() = _
    {New ParserError("Error 2", "Path", 1), _
    New ParserError("Error 3", "Path", 1)}
collection.AddRange(errors)

' Ads a collection of ParserError objects to the collection.
Dim errorsCollection As New ParserErrorCollection()
errorsCollection.Add(New ParserError("Error", "Path", 1))
errorsCollection.Add(New ParserError("Error", "Path", 1))
collection.AddRange(errorsCollection)

Açıklamalar

yönteminden Add farklı olarak yönteminin AddRange , eklenen bir nesnenin koleksiyonda zaten olup olmadığını belirlemek için kullanılabilecek bir ParserError dönüş değeri yoktur. Bu bilgilere ihtiyacınız varsa, kullanmadan önce yöntemini kullanın ContainsAddRange.

Şunlara uygulanır