Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
517 lines (442 sloc) 32.2 KB
<Type Name="ParserErrorCollection" FullName="System.Web.ParserErrorCollection">
<TypeSignature Language="C#" Value="public sealed class ParserErrorCollection : System.Collections.CollectionBase" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit ParserErrorCollection extends System.Collections.CollectionBase" />
<TypeSignature Language="DocId" Value="T:System.Web.ParserErrorCollection" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class ParserErrorCollection&#xA;Inherits CollectionBase" />
<TypeSignature Language="C++ CLI" Value="public ref class ParserErrorCollection sealed : System::Collections::CollectionBase" />
<TypeSignature Language="F#" Value="type ParserErrorCollection = class&#xA; inherit CollectionBase" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Collections.CollectionBase</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.Serializable</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Manages a set of parser errors detected during parsing. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.ParserErrorCollection> class provides methods and properties that you can use to manage a collection of <xref:System.Web.ParserError> objects. For example, you can add a set of parser errors to a collection upon parsing while using a custom <xref:System.Web.Compilation.BuildProvider> object to report all parse exceptions caught during parsing.
To add parser errors to, remove them from, or locate them in a collection, use the following:
- The <xref:System.Web.ParserErrorCollection.Add%2A> method to add a single <xref:System.Web.ParserError> object to the collection.
- The <xref:System.Web.ParserErrorCollection.AddRange%2A> methods to add multiple <xref:System.Web.ParserError> objects to the collection.
- Both the <xref:System.Web.ParserErrorCollection.Insert%2A> method and the <xref:System.Web.ParserErrorCollection.Item%2A> property, which is the <xref:System.Web.ParserErrorCollection> indexer, to add a single <xref:System.Web.ParserError> object to the collection at the specified index.
Additionally, you can use the <xref:System.Web.ParserErrorCollection> class to do the following:
- Remove <xref:System.Web.ParserError> objects with the <xref:System.Web.ParserErrorCollection.Remove%2A> method.
- Check whether a particular <xref:System.Web.ParserError> is in the collection by using the <xref:System.Web.ParserErrorCollection.Contains%2A> method.
- Find where a <xref:System.Web.ParserError> object is located in the collection by using the <xref:System.Web.ParserErrorCollection.IndexOf%2A> method.
## Examples
The following code example demonstrates how to use the <xref:System.Web.ParserErrorCollection> methods.
[!code-csharp[System.Web.ParserErrorCollection#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.ParserErrorCollection/CS/ParserErrorCollection_CS.aspx#1)]
[!code-vb[System.Web.ParserErrorCollection#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.ParserErrorCollection/VB/ParserErrorCollection_VB.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.Compilation.BuildProvider" />
<altmember cref="T:System.Web.HttpException" />
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Web.ParserErrorCollection" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ParserErrorCollection ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.ParserErrorCollection.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; ParserErrorCollection();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Web.ParserErrorCollection" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example demonstrates how to initialize an instance of the <xref:System.Web.ParserErrorCollection> class.
[!code-csharp[System.Web.ParserErrorCollection#2](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.ParserErrorCollection/CS/ParserErrorCollection_CS.aspx#2)]
[!code-vb[System.Web.ParserErrorCollection#2](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.ParserErrorCollection/VB/ParserErrorCollection_VB.aspx#2)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ParserErrorCollection (System.Web.ParserError[] value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Web.ParserError[] value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.ParserErrorCollection.#ctor(System.Web.ParserError[])" />
<MemberSignature Language="VB.NET" Value="Public Sub New (value As ParserError())" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; ParserErrorCollection(cli::array &lt;System::Web::ParserError ^&gt; ^ value);" />
<MemberSignature Language="F#" Value="new System.Web.ParserErrorCollection : System.Web.ParserError[] -&gt; System.Web.ParserErrorCollection" Usage="new System.Web.ParserErrorCollection value" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="value" Type="System.Web.ParserError[]" />
</Parameters>
<Docs>
<param name="value">An array of type <see cref="T:System.Web.ParserError" /> that specifies the errors to add to the collection.</param>
<summary>Initializes a new instance of the <see cref="T:System.Web.ParserErrorCollection" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.ParserErrorCollection.%23ctor%2A?displayProperty=nameWithType> constructor adds an array of <xref:System.Web.ParserError> objects to the collection.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Add">
<MemberSignature Language="C#" Value="public int Add (System.Web.ParserError value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance int32 Add(class System.Web.ParserError value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.ParserErrorCollection.Add(System.Web.ParserError)" />
<MemberSignature Language="VB.NET" Value="Public Function Add (value As ParserError) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; int Add(System::Web::ParserError ^ value);" />
<MemberSignature Language="F#" Value="member this.Add : System.Web.ParserError -&gt; int" Usage="parserErrorCollection.Add value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Web.ParserError" />
</Parameters>
<Docs>
<param name="value">The <see cref="T:System.Web.ParserError" /> value to add to the collection.</param>
<summary>Adds a value to the collection.</summary>
<returns>The index of the value within the collection; otherwise, -1 if the value is already in the collection.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.ParserErrorCollection.Add%2A> method to add an existing <xref:System.Web.ParserError> object to the collection. You cannot add the same <xref:System.Web.ParserError> object to the collection more than once. When you call the <xref:System.Web.ParserErrorCollection.Add%2A> method using a <xref:System.Web.ParserError> object that is already in the collection, the addition fails and -1 is returned.
To add multiple objects to the collection, use the <xref:System.Web.ParserErrorCollection.AddRange%2A> method.
## Examples
The following code example demonstrates how to add a <xref:System.Web.ParserError> object to a <xref:System.Web.ParserErrorCollection> object.
[!code-csharp[System.Web.ParserErrorCollection#3](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.ParserErrorCollection/CS/ParserErrorCollection_CS.aspx#3)]
[!code-vb[System.Web.ParserErrorCollection#3](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.ParserErrorCollection/VB/ParserErrorCollection_VB.aspx#3)]
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="AddRange">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Adds <see cref="T:System.Web.ParserError" /> objects to a collection.</summary>
</Docs>
</MemberGroup>
<Member MemberName="AddRange">
<MemberSignature Language="C#" Value="public void AddRange (System.Web.ParserError[] value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddRange(class System.Web.ParserError[] value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.ParserErrorCollection.AddRange(System.Web.ParserError[])" />
<MemberSignature Language="VB.NET" Value="Public Sub AddRange (value As ParserError())" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddRange(cli::array &lt;System::Web::ParserError ^&gt; ^ value);" />
<MemberSignature Language="F#" Value="member this.AddRange : System.Web.ParserError[] -&gt; unit" Usage="parserErrorCollection.AddRange value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Web.ParserError[]" />
</Parameters>
<Docs>
<param name="value">An array of type <see cref="T:System.Web.ParserError" /> that specifies the values to add to the collection.</param>
<summary>Adds an array of <see cref="T:System.Web.ParserError" /> objects to the collection.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.ParserErrorCollection.AddRange%2A> method to add an array of <xref:System.Web.ParserError> objects to the collection. The <xref:System.Web.ParserErrorCollection.AddRange%2A> method is useful when you create multiple <xref:System.Web.ParserError> objects and want to add them to the collection with a single method call. To add individual <xref:System.Web.ParserError> objects to the collection, use the <xref:System.Web.ParserErrorCollection.Add%2A> method.
## Examples
The following code example demonstrates how to add a range of <xref:System.Web.ParserError> objects to a <xref:System.Web.ParserErrorCollection> object.
[!code-csharp[System.Web.ParserErrorCollection#4](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.ParserErrorCollection/CS/ParserErrorCollection_CS.aspx#4)]
[!code-vb[System.Web.ParserErrorCollection#4](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.ParserErrorCollection/VB/ParserErrorCollection_VB.aspx#4)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="value" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="AddRange">
<MemberSignature Language="C#" Value="public void AddRange (System.Web.ParserErrorCollection value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddRange(class System.Web.ParserErrorCollection value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.ParserErrorCollection.AddRange(System.Web.ParserErrorCollection)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddRange (value As ParserErrorCollection)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddRange(System::Web::ParserErrorCollection ^ value);" />
<MemberSignature Language="F#" Value="member this.AddRange : System.Web.ParserErrorCollection -&gt; unit" Usage="parserErrorCollection.AddRange value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Web.ParserErrorCollection" />
</Parameters>
<Docs>
<param name="value">A <see cref="T:System.Web.ParserErrorCollection" /> containing the <see cref="T:System.Web.ParserError" /> objects to add to the collection.</param>
<summary>Adds the objects in an existing <see cref="T:System.Web.ParserErrorCollection" /> to the collection.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Unlike the <xref:System.Web.ParserErrorCollection.Add%2A> method, the <xref:System.Web.ParserErrorCollection.AddRange%2A> method does not have a return value that can be used to determine whether a <xref:System.Web.ParserError> object being added is already in the collection. If you need this information, use the <xref:System.Web.ParserErrorCollection.Contains%2A> method before using <xref:System.Web.ParserErrorCollection.AddRange%2A>.
## Examples
The following code example demonstrates how to add a range of <xref:System.Web.ParserError> objects to a <xref:System.Web.ParserErrorCollection> object.
[!code-csharp[System.Web.ParserErrorCollection#4](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.ParserErrorCollection/CS/ParserErrorCollection_CS.aspx#4)]
[!code-vb[System.Web.ParserErrorCollection#4](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.ParserErrorCollection/VB/ParserErrorCollection_VB.aspx#4)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <see cref="T:System.Web.ParserError" /> value is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Contains">
<MemberSignature Language="C#" Value="public bool Contains (System.Web.ParserError value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool Contains(class System.Web.ParserError value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.ParserErrorCollection.Contains(System.Web.ParserError)" />
<MemberSignature Language="VB.NET" Value="Public Function Contains (value As ParserError) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool Contains(System::Web::ParserError ^ value);" />
<MemberSignature Language="F#" Value="member this.Contains : System.Web.ParserError -&gt; bool" Usage="parserErrorCollection.Contains value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Web.ParserError" />
</Parameters>
<Docs>
<param name="value">The <see cref="T:System.Web.ParserError" /> to locate in the collection.</param>
<summary>Determines whether the <see cref="T:System.Web.ParserError" /> object is located in the collection.</summary>
<returns>
<see langword="true" /> if the <see cref="T:System.Web.ParserError" /> is in the collection; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You cannot add the same <xref:System.Web.ParserError> object to the collection more than once. However, attempting to add a <xref:System.Web.ParserError> object more than once will not throw an exception. Instead, the addition will fail. In this case, the <xref:System.Web.ParserErrorCollection.Add%2A> method will return a value of -1. However, the <xref:System.Web.ParserErrorCollection.AddRange%2A> and <xref:System.Web.ParserErrorCollection.Insert%2A> methods do not have return values. When adding <xref:System.Web.ParserError> objects by using one of these methods, use the <xref:System.Web.ParserErrorCollection.Contains%2A> method to determine whether a particular <xref:System.Web.ParserError> object is already in the collection.
## Examples
The following code example demonstrates how to search for an instance of a specified <xref:System.Web.ParserError> object in a <xref:System.Web.ParserErrorCollection> object.
[!code-csharp[System.Web.ParserErrorCollection#5](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.ParserErrorCollection/CS/ParserErrorCollection_CS.aspx#5)]
[!code-vb[System.Web.ParserErrorCollection#5](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.ParserErrorCollection/VB/ParserErrorCollection_VB.aspx#5)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CopyTo">
<MemberSignature Language="C#" Value="public void CopyTo (System.Web.ParserError[] array, int index);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void CopyTo(class System.Web.ParserError[] array, int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.ParserErrorCollection.CopyTo(System.Web.ParserError[],System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub CopyTo (array As ParserError(), index As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void CopyTo(cli::array &lt;System::Web::ParserError ^&gt; ^ array, int index);" />
<MemberSignature Language="F#" Value="member this.CopyTo : System.Web.ParserError[] * int -&gt; unit" Usage="parserErrorCollection.CopyTo (array, index)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="array" Type="System.Web.ParserError[]" />
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<param name="array">An array of type <see cref="T:System.Web.ParserError" /> to which the parser errors in the collection are copied.</param>
<param name="index">The first index within the array to which the <see cref="T:System.Web.ParserError" /> is copied.</param>
<summary>Copies the <see cref="T:System.Web.ParserError" /> objects in the collection to a compatible one-dimensional array, starting at the specified index of the target array.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.ParserErrorCollection.CopyTo%2A> method to copy the <xref:System.Web.ParserError> objects in a collection (including the item references they contain) to a compatible array, starting at a specified index. This is useful when you want to sort the <xref:System.Web.ParserError> objects in the collection by using the <xref:System.Array.Sort%2A> method. To do this:
1. Copy the <xref:System.Web.ParserError> objects into a compatible array.
2. Sort the array.
3. Use the <xref:System.Web.ParserErrorCollection.Remove%2A> method to remove all the <xref:System.Web.ParserError> objects from the collection.
4. Use the <xref:System.Web.ParserErrorCollection.AddRange%2A> method to add the sorted array back to the collection.
## Examples
The following code example demonstrates how to copy the contents of a <xref:System.Web.ParserErrorCollection> object to the specified <xref:System.Web.ParserError> array.
[!code-csharp[System.Web.ParserErrorCollection#6](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.ParserErrorCollection/CS/ParserErrorCollection_CS.aspx#6)]
[!code-vb[System.Web.ParserErrorCollection#6](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.ParserErrorCollection/VB/ParserErrorCollection_VB.aspx#6)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IndexOf">
<MemberSignature Language="C#" Value="public int IndexOf (System.Web.ParserError value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance int32 IndexOf(class System.Web.ParserError value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.ParserErrorCollection.IndexOf(System.Web.ParserError)" />
<MemberSignature Language="VB.NET" Value="Public Function IndexOf (value As ParserError) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; int IndexOf(System::Web::ParserError ^ value);" />
<MemberSignature Language="F#" Value="member this.IndexOf : System.Web.ParserError -&gt; int" Usage="parserErrorCollection.IndexOf value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Web.ParserError" />
</Parameters>
<Docs>
<param name="value">The <see cref="T:System.Web.ParserError" /> to locate in the collection.</param>
<summary>Gets the index of the specified <see cref="T:System.Web.ParserError" /> object in the collection.</summary>
<returns>The zero-based index of the <see cref="T:System.Web.ParserError" /> objects within the collection; otherwise, 1 if the <see cref="T:System.Web.ParserError" /> is not in the collection.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.ParserErrorCollection.IndexOf%2A> method to determine the index of a <xref:System.Web.ParserError> object within the collection. This is useful to determine the index of each <xref:System.Web.ParserError> when you iterate through the collection by using the <xref:System.Collections.IEnumerator> object returned by the <xref:System.Collections.CollectionBase.GetEnumerator%2A> method.
## Examples
The following code example demonstrates how to locate the index of a <xref:System.Web.ParserError> object at the specified index in a <xref:System.Web.ParserErrorCollection> collection.
[!code-csharp[System.Web.ParserErrorCollection#5](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.ParserErrorCollection/CS/ParserErrorCollection_CS.aspx#5)]
[!code-vb[System.Web.ParserErrorCollection#5](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.ParserErrorCollection/VB/ParserErrorCollection_VB.aspx#5)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Insert">
<MemberSignature Language="C#" Value="public void Insert (int index, System.Web.ParserError value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Insert(int32 index, class System.Web.ParserError value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.ParserErrorCollection.Insert(System.Int32,System.Web.ParserError)" />
<MemberSignature Language="VB.NET" Value="Public Sub Insert (index As Integer, value As ParserError)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Insert(int index, System::Web::ParserError ^ value);" />
<MemberSignature Language="F#" Value="member this.Insert : int * System.Web.ParserError -&gt; unit" Usage="parserErrorCollection.Insert (index, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
<Parameter Name="value" Type="System.Web.ParserError" />
</Parameters>
<Docs>
<param name="index">The index within the collection at which to insert the <see cref="T:System.Web.ParserError" />.</param>
<param name="value">The <see cref="T:System.Web.ParserError" /> object to insert into the collection.</param>
<summary>Inserts the specified <see cref="T:System.Web.ParserError" /> object into the collection at the specified index.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.ParserErrorCollection.Insert%2A> method to insert an existing <xref:System.Web.ParserError> object at a particular index within the collection.
You cannot add the same <xref:System.Web.ParserError> object to the collection more than once. When you call the <xref:System.Web.ParserErrorCollection.Insert%2A> method by using a <xref:System.Web.ParserError> that is already in the collection, the insertion fails. Use the <xref:System.Web.ParserErrorCollection.Contains%2A> method before the insertion to determine whether a particular <xref:System.Web.ParserError> is already in the collection. To reposition a <xref:System.Web.ParserError> within the collection, you must first remove it by using the <xref:System.Web.ParserErrorCollection.Remove%2A> method and then insert it at the desired index by using <xref:System.Web.ParserErrorCollection.Insert%2A>.
## Examples
The following code example demonstrates how to insert a <xref:System.Web.ParserError> object at the specified index in a <xref:System.Web.ParserErrorCollection> collection.
[!code-csharp[System.Web.ParserErrorCollection#8](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.ParserErrorCollection/CS/ParserErrorCollection_CS.aspx#8)]
[!code-vb[System.Web.ParserErrorCollection#8](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.ParserErrorCollection/VB/ParserErrorCollection_VB.aspx#8)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Item">
<MemberSignature Language="C#" Value="public System.Web.ParserError this[int index] { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.ParserError Item(int32)" />
<MemberSignature Language="DocId" Value="P:System.Web.ParserErrorCollection.Item(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Default Public Property Item(index As Integer) As ParserError" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::ParserError ^ default[int] { System::Web::ParserError ^ get(int index); void set(int index, System::Web::ParserError ^ value); };" />
<MemberSignature Language="F#" Value="member this.Item(int) : System.Web.ParserError with get, set" Usage="System.Web.ParserErrorCollection.Item" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.ParserError</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<param name="index">The index within the collection of the <see cref="T:System.Web.ParserError" /> object to get or set.</param>
<summary>Gets or sets the <see cref="T:System.Web.ParserError" /> object at the specified index within the collection.</summary>
<value>The <see cref="T:System.Web.ParserError" /> at the specified index within the collection.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.ParserErrorCollection.Item%2A> property to retrieve the <xref:System.Web.ParserError> object at the specified index within the collection. When you have a reference to the <xref:System.Web.ParserError> object and need the index, use the <xref:System.Web.ParserErrorCollection.IndexOf%2A> method.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Remove">
<MemberSignature Language="C#" Value="public void Remove (System.Web.ParserError value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Remove(class System.Web.ParserError value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.ParserErrorCollection.Remove(System.Web.ParserError)" />
<MemberSignature Language="VB.NET" Value="Public Sub Remove (value As ParserError)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Remove(System::Web::ParserError ^ value);" />
<MemberSignature Language="F#" Value="member this.Remove : System.Web.ParserError -&gt; unit" Usage="parserErrorCollection.Remove value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Web.ParserError" />
</Parameters>
<Docs>
<param name="value">The <see cref="T:System.Web.ParserError" /> to remove from the collection.</param>
<summary>Removes the specified <see cref="T:System.Web.ParserError" /> object from the collection.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.ParserErrorCollection.Remove%2A> method to remove a <xref:System.Web.ParserError> object from the collection when you have a reference to the <xref:System.Web.ParserError>.
## Examples
The following code example demonstrates how to remove a <xref:System.Web.ParserError> from the specified index in a <xref:System.Web.ParserErrorCollection> object.
[!code-csharp[System.Web.ParserErrorCollection#8](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.ParserErrorCollection/CS/ParserErrorCollection_CS.aspx#8)]
[!code-vb[System.Web.ParserErrorCollection#8](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.ParserErrorCollection/VB/ParserErrorCollection_VB.aspx#8)]
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.