Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
1493 lines (1360 sloc) 85.9 KB
<Type Name="BitArray" FullName="System.Collections.BitArray">
<TypeSignature Language="C#" Value="public sealed class BitArray : ICloneable, System.Collections.ICollection" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit BitArray extends System.Object implements class System.Collections.ICollection, class System.Collections.IEnumerable, class System.ICloneable" />
<TypeSignature Language="DocId" Value="T:System.Collections.BitArray" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class BitArray&#xA;Implements ICloneable, ICollection" />
<TypeSignature Language="C++ CLI" Value="public ref class BitArray sealed : ICloneable, System::Collections::ICollection" />
<TypeSignature Language="F#" Value="type BitArray = class&#xA; interface ICollection&#xA; interface ICloneable&#xA; interface IEnumerable" />
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Collections.ICollection</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Collections.IEnumerable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.ICloneable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.Serializable</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Manages a compact array of bit values, which are represented as Booleans, where <see langword="true" /> indicates that the bit is on (1) and <see langword="false" /> indicates the bit is off (0).</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Collections.BitArray> class is a collection class in which the capacity is always the same as the count. Elements are added to a <xref:System.Collections.BitArray> by increasing the <xref:System.Collections.BitArray.Length%2A> property; elements are deleted by decreasing the <xref:System.Collections.BitArray.Length%2A> property. The size of a <xref:System.Collections.BitArray> is controlled by the client; indexing past the end of the <xref:System.Collections.BitArray> throws an <xref:System.ArgumentException>.The <xref:System.Collections.BitArray> class provides methods that are not found in other collections, including those that allow multiple elements to be modified at once using a filter, such as <xref:System.Collections.BitArray.And%2A>, <xref:System.Collections.BitArray.Or%2A>, <xref:System.Collections.BitArray.Xor%2A> , <xref:System.Collections.BitArray.Not%2A>, and <xref:System.Collections.BitArray.SetAll%2A>.
The <xref:System.Collections.Specialized.BitVector32> class is a structure that provides the same functionality as <xref:System.Collections.BitArray>, but with faster performance. <xref:System.Collections.Specialized.BitVector32> is faster because it is a value type and therefore allocated on the stack, whereas <xref:System.Collections.BitArray> is a reference type and, therefore, allocated on the heap.
<xref:System.Collections.Specialized.BitVector32?displayProperty=nameWithType> can store exactly 32 bits, whereas <xref:System.Collections.BitArray> can store a variable number of bits. <xref:System.Collections.Specialized.BitVector32> stores both bit flags and small integers, thereby making it ideal for data that is not exposed to the user. However, if the number of required bit flags is unknown, is variable, or is greater than 32, use <xref:System.Collections.BitArray> instead.
<xref:System.Collections.BitArray> is in the <xref:System.Collections> namespace; <xref:System.Collections.Specialized.BitVector32> is in the <xref:System.Collections.Specialized> namespace.
Elements in this collection can be accessed using an integer index. Indexes in this collection are zero-based.
## Examples
The following code example shows how to create and initialize a <xref:System.Collections.BitArray> and how to print out its values.
[!code-cpp[Classic BitArray Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic BitArray Example/CPP/source.cpp#1)]
[!code-csharp[Classic BitArray Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray Example/CS/source.cs#1)]
[!code-vb[Classic BitArray Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic BitArray Example/VB/source.vb#1)]
]]></format>
</remarks>
<threadsafe>Public static (<see langword="Shared" /> in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
This implementation does not provide a synchronized (thread safe) wrapper for a <see cref="T:System.Collections.BitArray" />.
Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.</threadsafe>
<altmember cref="T:System.Collections.Specialized.BitVector32" />
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Collections.BitArray" /> class whose capacity and initial values can be specified.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BitArray (bool[] values);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(bool[] values) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.#ctor(System.Boolean[])" />
<MemberSignature Language="VB.NET" Value="Public Sub New (values As Boolean())" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; BitArray(cli::array &lt;bool&gt; ^ values);" />
<MemberSignature Language="F#" Value="new System.Collections.BitArray : bool[] -&gt; System.Collections.BitArray" Usage="new System.Collections.BitArray values" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="values" Type="System.Boolean[]" />
</Parameters>
<Docs>
<param name="values">An array of Booleans to copy.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.BitArray" /> class that contains bit values copied from the specified array of Booleans.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor is an O(`n`) operation, where `n` is the number of elements in `values`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="values" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BitArray (byte[] bytes);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(unsigned int8[] bytes) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.#ctor(System.Byte[])" />
<MemberSignature Language="VB.NET" Value="Public Sub New (bytes As Byte())" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; BitArray(cli::array &lt;System::Byte&gt; ^ bytes);" />
<MemberSignature Language="F#" Value="new System.Collections.BitArray : byte[] -&gt; System.Collections.BitArray" Usage="new System.Collections.BitArray bytes" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="bytes" Type="System.Byte[]" />
</Parameters>
<Docs>
<param name="bytes">An array of bytes containing the values to copy, where each byte represents eight consecutive bits.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.BitArray" /> class that contains bit values copied from the specified array of bytes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The first byte in the array represents bits 0 through 7, the second byte represents bits 8 through 15, and so on. The Least Significant Bit of each byte represents the lowest index value: " `bytes` [0] & 1" represents bit 0, " `bytes` [0] & 2" represents bit 1, " `bytes` [0] & 4" represents bit 2, and so on.
This constructor is an O(`n`) operation, where `n` is the number of elements in `bytes`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="bytes" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">The length of <paramref name="bytes" /> is greater than <see cref="F:System.Int32.MaxValue" />.</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BitArray (System.Collections.BitArray bits);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Collections.BitArray bits) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.#ctor(System.Collections.BitArray)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (bits As BitArray)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; BitArray(System::Collections::BitArray ^ bits);" />
<MemberSignature Language="F#" Value="new System.Collections.BitArray : System.Collections.BitArray -&gt; System.Collections.BitArray" Usage="new System.Collections.BitArray bits" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="bits" Type="System.Collections.BitArray" />
</Parameters>
<Docs>
<param name="bits">The <see cref="T:System.Collections.BitArray" /> to copy.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.BitArray" /> class that contains bit values copied from the specified <see cref="T:System.Collections.BitArray" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor is an O(`n`) operation, where `n` is the number of elements in `bits`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="bits" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BitArray (int length);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int32 length) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.#ctor(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (length As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; BitArray(int length);" />
<MemberSignature Language="F#" Value="new System.Collections.BitArray : int -&gt; System.Collections.BitArray" Usage="new System.Collections.BitArray length" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="length" Type="System.Int32" />
</Parameters>
<Docs>
<param name="length">The number of bit values in the new <see cref="T:System.Collections.BitArray" />.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.BitArray" /> class that can hold the specified number of bit values, which are initially set to <see langword="false" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor is an O(`n`) operation, where `n` is `length`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="length" /> is less than zero.</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BitArray (int[] values);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int32[] values) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.#ctor(System.Int32[])" />
<MemberSignature Language="VB.NET" Value="Public Sub New (values As Integer())" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; BitArray(cli::array &lt;int&gt; ^ values);" />
<MemberSignature Language="F#" Value="new System.Collections.BitArray : int[] -&gt; System.Collections.BitArray" Usage="new System.Collections.BitArray values" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="values" Type="System.Int32[]" />
</Parameters>
<Docs>
<param name="values">An array of integers containing the values to copy, where each integer represents 32 consecutive bits.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.BitArray" /> class that contains bit values copied from the specified array of 32-bit integers.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The number in the first `values` array element represents bits 0 through 31, the second number in the array represents bits 32 through 63, and so on. The Least Significant Bit of each integer represents the lowest index value: " `values` [0] & 1" represents bit 0, " `values` [0] & 2" represents bit 1, " `values` [0] & 4" represents bit 2, and so on.
This constructor is an O(`n`) operation, where `n` is the number of elements in `values`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="values" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">The length of <paramref name="values" /> is greater than <see cref="F:System.Int32.MaxValue" /></exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BitArray (int length, bool defaultValue);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int32 length, bool defaultValue) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.#ctor(System.Int32,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (length As Integer, defaultValue As Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; BitArray(int length, bool defaultValue);" />
<MemberSignature Language="F#" Value="new System.Collections.BitArray : int * bool -&gt; System.Collections.BitArray" Usage="new System.Collections.BitArray (length, defaultValue)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="length" Type="System.Int32" />
<Parameter Name="defaultValue" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="length">The number of bit values in the new <see cref="T:System.Collections.BitArray" />.</param>
<param name="defaultValue">The Boolean value to assign to each bit.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.BitArray" /> class that can hold the specified number of bit values, which are initially set to the specified value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor is an O(`n`) operation, where `n` is `length`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="length" /> is less than zero.</exception>
</Docs>
</Member>
<Member MemberName="And">
<MemberSignature Language="C#" Value="public System.Collections.BitArray And (System.Collections.BitArray value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Collections.BitArray And(class System.Collections.BitArray value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.And(System.Collections.BitArray)" />
<MemberSignature Language="VB.NET" Value="Public Function And (value As BitArray) As BitArray" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Collections::BitArray ^ And(System::Collections::BitArray ^ value);" />
<MemberSignature Language="F#" Value="member this.And : System.Collections.BitArray -&gt; System.Collections.BitArray" Usage="bitArray.And value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.BitArray</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Collections.BitArray" />
</Parameters>
<Docs>
<param name="value">The array with which to perform the bitwise AND operation.</param>
<summary>Performs the bitwise AND operation between the elements of the current <see cref="T:System.Collections.BitArray" /> object and the corresponding elements in the specified array. The current <see cref="T:System.Collections.BitArray" /> object will be modified to store the result of the bitwise AND operation.</summary>
<returns>An array containing the result of the bitwise AND operation, which is a reference to the current <see cref="T:System.Collections.BitArray" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The bitwise AND operation returns `true` if both operands are `true`, and returns `false` if one or both operands are `false`.
This method is an O(`n`) operation, where `n` is <xref:System.Collections.BitArray.Count%2A>.
## Examples
The following code example shows how to perform the bitwise AND operation between two <xref:System.Collections.BitArray> objects.
[!code-cpp[Classic BitArray.And Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic BitArray.And Example/CPP/source.cpp#1)]
[!code-csharp[Classic BitArray.And Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.And Example/CS/source.cs#1)]
[!code-vb[Classic BitArray.And Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic BitArray.And Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="value" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="value" /> and the current <see cref="T:System.Collections.BitArray" /> do not have the same number of elements.</exception>
</Docs>
</Member>
<Member MemberName="Clone">
<MemberSignature Language="C#" Value="public object Clone ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance object Clone() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.Clone" />
<MemberSignature Language="VB.NET" Value="Public Function Clone () As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Object ^ Clone();" />
<MemberSignature Language="F#" Value="abstract member Clone : unit -&gt; obj&#xA;override this.Clone : unit -&gt; obj" Usage="bitArray.Clone " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.ICloneable.Clone</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a shallow copy of the <see cref="T:System.Collections.BitArray" />.</summary>
<returns>A shallow copy of the <see cref="T:System.Collections.BitArray" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A shallow copy of a collection copies only the elements of the collection, whether they are reference types or value types, but it does not copy the objects that the references refer to. The references in the new collection point to the same objects that the references in the original collection point to.
In contrast, a deep copy of a collection copies the elements and everything directly or indirectly referenced by the elements.
This method is an O(`n`) operation, where `n` is <xref:System.Collections.BitArray.Count%2A>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CopyTo">
<MemberSignature Language="C#" Value="public void CopyTo (Array array, int index);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void CopyTo(class System.Array array, int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.CopyTo(System.Array,System.Int32)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void CopyTo(Array ^ array, int index);" />
<MemberSignature Language="F#" Value="abstract member CopyTo : Array * int -&gt; unit&#xA;override this.CopyTo : Array * int -&gt; unit" Usage="bitArray.CopyTo (array, index)" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Collections.ICollection.CopyTo(System.Array,System.Int32)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="array" Type="System.Array" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="index" Type="System.Int32" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.BitArray" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
<param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
<summary>Copies the entire <see cref="T:System.Collections.BitArray" /> to a compatible one-dimensional <see cref="T:System.Array" />, starting at the specified index of the target array.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The specified array must be of a compatible type. Only `bool`, `int`, and `byte` types of arrays are supported.
This method uses <xref:System.Array.Copy%2A?displayProperty=nameWithType> to copy the elements.
This method is an O(`n`) operation, where `n` is <xref:System.Collections.BitArray.Count%2A>.
## Examples
The following code example shows how to copy a <xref:System.Collections.BitArray> into a one-dimensional <xref:System.Array>.
[!code-cpp[Classic BitArray.CopyTo Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic BitArray.CopyTo Example/CPP/source.cpp#1)]
[!code-csharp[Classic BitArray.CopyTo Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.CopyTo Example/CS/source.cs#1)]
[!code-vb[Classic BitArray.CopyTo Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic BitArray.CopyTo Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="array" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> is less than zero.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="array" /> is multidimensional.
-or-
The number of elements in the source <see cref="T:System.Collections.BitArray" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.</exception>
<exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.BitArray" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
<altmember cref="T:System.Array" />
</Docs>
</Member>
<Member MemberName="Count">
<MemberSignature Language="C#" Value="public int Count { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Count" />
<MemberSignature Language="DocId" Value="P:System.Collections.BitArray.Count" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Count As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int Count { int get(); };" />
<MemberSignature Language="F#" Value="member this.Count : int" Usage="System.Collections.BitArray.Count" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Collections.ICollection.Count</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the number of elements contained in the <see cref="T:System.Collections.BitArray" />.</summary>
<value>The number of elements contained in the <see cref="T:System.Collections.BitArray" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Collections.BitArray.Length%2A> and <xref:System.Collections.BitArray.Count%2A> return the same value. <xref:System.Collections.BitArray.Length%2A> can be set to a specific value, but <xref:System.Collections.BitArray.Count%2A> is read-only.
Retrieving the value of this property is an O(1) operation.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Get">
<MemberSignature Language="C#" Value="public bool Get (int index);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool Get(int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.Get(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function Get (index As Integer) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool Get(int index);" />
<MemberSignature Language="F#" Value="member this.Get : int -&gt; bool" Usage="bitArray.Get index" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<param name="index">The zero-based index of the value to get.</param>
<summary>Gets the value of the bit at a specific position in the <see cref="T:System.Collections.BitArray" />.</summary>
<returns>The value of the bit at position <paramref name="index" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is an O(1) operation.
## Examples
The following code example shows how to set and get specific elements in a <xref:System.Collections.BitArray>.
[!code-cpp[Classic BitArray.Get Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic BitArray.Get Example/CPP/source.cpp#1)]
[!code-csharp[Classic BitArray.Get Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Get Example/CS/source.cs#1)]
[!code-vb[Classic BitArray.Get Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic BitArray.Get Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> is less than zero.
-or-
<paramref name="index" /> is greater than or equal to the number of elements in the <see cref="T:System.Collections.BitArray" />.</exception>
</Docs>
</Member>
<Member MemberName="GetEnumerator">
<MemberSignature Language="C#" Value="public System.Collections.IEnumerator GetEnumerator ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.IEnumerator GetEnumerator() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.GetEnumerator" />
<MemberSignature Language="VB.NET" Value="Public Function GetEnumerator () As IEnumerator" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Collections::IEnumerator ^ GetEnumerator();" />
<MemberSignature Language="F#" Value="abstract member GetEnumerator : unit -&gt; System.Collections.IEnumerator&#xA;override this.GetEnumerator : unit -&gt; System.Collections.IEnumerator" Usage="bitArray.GetEnumerator " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Collections.IEnumerable.GetEnumerator</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.IEnumerator</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns an enumerator that iterates through the <see cref="T:System.Collections.BitArray" />.</summary>
<returns>An <see cref="T:System.Collections.IEnumerator" /> for the entire <see cref="T:System.Collections.BitArray" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The `foreach` statement of the C# language (`for each` in Visual Basic) hides the complexity of the enumerators. Therefore, using `foreach` is recommended, instead of directly manipulating the enumerator.
Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.
Initially, the enumerator is positioned before the first element in the collection. <xref:System.Collections.IEnumerator.Reset%2A> also brings the enumerator back to this position. At this position, <xref:System.Collections.IEnumerator.Current%2A> is undefined. Therefore, you must call <xref:System.Collections.IEnumerator.MoveNext%2A> to advance the enumerator to the first element of the collection before reading the value of <xref:System.Collections.IEnumerator.Current%2A>.
<xref:System.Collections.IEnumerator.Current%2A> returns the same object until either <xref:System.Collections.IEnumerator.MoveNext%2A> or <xref:System.Collections.IEnumerator.Reset%2A> is called. <xref:System.Collections.IEnumerator.MoveNext%2A> sets <xref:System.Collections.IEnumerator.Current%2A> to the next element.
If <xref:System.Collections.IEnumerator.MoveNext%2A> passes the end of the collection, the enumerator is positioned after the last element in the collection and <xref:System.Collections.IEnumerator.MoveNext%2A> returns `false`. When the enumerator is at this position, subsequent calls to <xref:System.Collections.IEnumerator.MoveNext%2A> also return `false`. If the last call to <xref:System.Collections.IEnumerator.MoveNext%2A> returned `false`, <xref:System.Collections.IEnumerator.Current%2A> is undefined. To set <xref:System.Collections.IEnumerator.Current%2A> to the first element of the collection again, you can call <xref:System.Collections.IEnumerator.Reset%2A> followed by <xref:System.Collections.IEnumerator.MoveNext%2A>.
An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.
The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.
This method is an O(1) operation.
]]></format>
</remarks>
<altmember cref="T:System.Collections.IEnumerator" />
</Docs>
</Member>
<Member MemberName="IsReadOnly">
<MemberSignature Language="C#" Value="public bool IsReadOnly { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsReadOnly" />
<MemberSignature Language="DocId" Value="P:System.Collections.BitArray.IsReadOnly" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsReadOnly As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool IsReadOnly { bool get(); };" />
<MemberSignature Language="F#" Value="member this.IsReadOnly : bool" Usage="System.Collections.BitArray.IsReadOnly" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the <see cref="T:System.Collections.BitArray" /> is read-only.</summary>
<value>This property is always <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Collections.BitArray> implements the <xref:System.Collections.BitArray.IsReadOnly%2A> property because it is required by the <xref:System.Collections.IList?displayProperty=nameWithType> interface.
A collection that is read-only does not allow the addition, removal, or modification of elements after the collection is created.
A collection that is read-only is simply a collection with a wrapper that prevents modifying the collection; therefore, if changes are made to the underlying collection, the read-only collection reflects those changes.
This method is an O(1) operation.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IsSynchronized">
<MemberSignature Language="C#" Value="public bool IsSynchronized { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsSynchronized" />
<MemberSignature Language="DocId" Value="P:System.Collections.BitArray.IsSynchronized" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsSynchronized As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool IsSynchronized { bool get(); };" />
<MemberSignature Language="F#" Value="member this.IsSynchronized : bool" Usage="System.Collections.BitArray.IsSynchronized" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Collections.ICollection.IsSynchronized</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether access to the <see cref="T:System.Collections.BitArray" /> is synchronized (thread safe).</summary>
<value>This property is always <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Collections.BitArray> implements the <xref:System.Collections.BitArray.IsSynchronized%2A> property because it is required by the <xref:System.Collections.ICollection?displayProperty=nameWithType> interface.
Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.
## Examples
The following code example shows how to lock the collection using the <xref:System.Collections.BitArray.SyncRoot%2A> during the entire enumeration.
[!code-cpp[Classic BitArray Example#2](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic BitArray Example/CPP/source2.cpp#2)]
[!code-csharp[Classic BitArray Example#2](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray Example/CS/source2.cs#2)]
[!code-vb[Classic BitArray Example#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic BitArray Example/VB/source2.vb#2)]
This method is an O(1) operation.
]]></format>
</remarks>
<altmember cref="P:System.Collections.BitArray.SyncRoot" />
</Docs>
</Member>
<Member MemberName="Item">
<MemberSignature Language="C#" Value="public bool this[int index] { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Item(int32)" />
<MemberSignature Language="DocId" Value="P:System.Collections.BitArray.Item(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Default Public Property Item(index As Integer) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool default[int] { bool get(int index); void set(int index, bool value); };" />
<MemberSignature Language="F#" Value="member this.Item(int) : bool with get, set" Usage="System.Collections.BitArray.Item" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<param name="index">The zero-based index of the value to get or set.</param>
<summary>Gets or sets the value of the bit at a specific position in the <see cref="T:System.Collections.BitArray" />.</summary>
<value>The value of the bit at position <paramref name="index" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[index]`.
The C# language uses the [this](~/docs/csharp/language-reference/keywords/this.md) keyword to define the indexers instead of implementing the <xref:System.Collections.BitArray.Item%2A> property. Visual Basic implements <xref:System.Collections.BitArray.Item%2A> as a default property, which provides the same indexing functionality.
Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> is less than zero.
-or-
<paramref name="index" /> is equal to or greater than <see cref="P:System.Collections.BitArray.Count" />.</exception>
<altmember cref="P:System.Collections.BitArray.Count" />
</Docs>
</Member>
<Member MemberName="LeftShift">
<MemberSignature Language="C#" Value="public System.Collections.BitArray LeftShift (int count);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Collections.BitArray LeftShift(int32 count) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.LeftShift(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function LeftShift (count As Integer) As BitArray" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Collections::BitArray ^ LeftShift(int count);" />
<MemberSignature Language="F#" Value="member this.LeftShift : int -&gt; System.Collections.BitArray" Usage="bitArray.LeftShift count" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.BitArray</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="count" Type="System.Int32" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="count">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Length">
<MemberSignature Language="C#" Value="public int Length { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Length" />
<MemberSignature Language="DocId" Value="P:System.Collections.BitArray.Length" />
<MemberSignature Language="VB.NET" Value="Public Property Length As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int Length { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.Length : int with get, set" Usage="System.Collections.BitArray.Length" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the number of elements in the <see cref="T:System.Collections.BitArray" />.</summary>
<value>The number of elements in the <see cref="T:System.Collections.BitArray" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Collections.BitArray.Length%2A> and <xref:System.Collections.BitArray.Count%2A> return the same value. <xref:System.Collections.BitArray.Length%2A> can be set to a specific value, but <xref:System.Collections.BitArray.Count%2A> is read-only.
If <xref:System.Collections.BitArray.Length%2A> is set to a value that is less than <xref:System.Collections.BitArray.Count%2A>, the <xref:System.Collections.BitArray> is truncated and the elements after the index `value` -1 are deleted.
If <xref:System.Collections.BitArray.Length%2A> is set to a value that is greater than <xref:System.Collections.BitArray.Count%2A>, the new elements are set to `false`.
Retrieving the value of this property is an O(1) operation. Setting this property is an O(`n`) operation.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The property is set to a value that is less than zero.</exception>
</Docs>
</Member>
<Member MemberName="Not">
<MemberSignature Language="C#" Value="public System.Collections.BitArray Not ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Collections.BitArray Not() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.Not" />
<MemberSignature Language="VB.NET" Value="Public Function Not () As BitArray" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Collections::BitArray ^ Not();" />
<MemberSignature Language="F#" Value="member this.Not : unit -&gt; System.Collections.BitArray" Usage="bitArray.Not " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.BitArray</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Inverts all the bit values in the current <see cref="T:System.Collections.BitArray" />, so that elements set to <see langword="true" /> are changed to <see langword="false" />, and elements set to <see langword="false" /> are changed to <see langword="true" />.</summary>
<returns>The current instance with inverted bit values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is an O(`n`) operation, where `n` is <xref:System.Collections.BitArray.Count%2A>.
## Examples
The following code example shows how to apply NOT to a <xref:System.Collections.BitArray>.
[!code-cpp[Classic BitArray.Not Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic BitArray.Not Example/CPP/source.cpp#1)]
[!code-csharp[Classic BitArray.Not Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Not Example/CS/source.cs#1)]
[!code-vb[Classic BitArray.Not Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic BitArray.Not Example/VB/source.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Or">
<MemberSignature Language="C#" Value="public System.Collections.BitArray Or (System.Collections.BitArray value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Collections.BitArray Or(class System.Collections.BitArray value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.Or(System.Collections.BitArray)" />
<MemberSignature Language="VB.NET" Value="Public Function Or (value As BitArray) As BitArray" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Collections::BitArray ^ Or(System::Collections::BitArray ^ value);" />
<MemberSignature Language="F#" Value="member this.Or : System.Collections.BitArray -&gt; System.Collections.BitArray" Usage="bitArray.Or value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.BitArray</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Collections.BitArray" />
</Parameters>
<Docs>
<param name="value">The array with which to perform the bitwise OR operation.</param>
<summary>Performs the bitwise OR operation between the elements of the current <see cref="T:System.Collections.BitArray" /> object and the corresponding elements in the specified array. The current <see cref="T:System.Collections.BitArray" /> object will be modified to store the result of the bitwise OR operation.</summary>
<returns>An array containing the result of the bitwise OR operation, which is a reference to the current <see cref="T:System.Collections.BitArray" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The bitwise OR operation returns `true` if one or both operands are `true`, and returns `false` if both operands are `false`.
This method is an O(`n`) operation, where `n` is <xref:System.Collections.BitArray.Count%2A>.
## Examples
The following code example shows how to perform the OR operation between two <xref:System.Collections.BitArray> objects.
[!code-cpp[Classic BitArray.Or Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic BitArray.Or Example/CPP/source.cpp#1)]
[!code-csharp[Classic BitArray.Or Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Or Example/CS/source.cs#1)]
[!code-vb[Classic BitArray.Or Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic BitArray.Or Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="value" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="value" /> and the current <see cref="T:System.Collections.BitArray" /> do not have the same number of elements.</exception>
</Docs>
</Member>
<Member MemberName="RightShift">
<MemberSignature Language="C#" Value="public System.Collections.BitArray RightShift (int count);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Collections.BitArray RightShift(int32 count) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.RightShift(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function RightShift (count As Integer) As BitArray" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Collections::BitArray ^ RightShift(int count);" />
<MemberSignature Language="F#" Value="member this.RightShift : int -&gt; System.Collections.BitArray" Usage="bitArray.RightShift count" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.BitArray</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="count" Type="System.Int32" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="count">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Set">
<MemberSignature Language="C#" Value="public void Set (int index, bool value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Set(int32 index, bool value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.Set(System.Int32,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Sub Set (index As Integer, value As Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Set(int index, bool value);" />
<MemberSignature Language="F#" Value="member this.Set : int * bool -&gt; unit" Usage="bitArray.Set (index, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
<Parameter Name="value" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="index">The zero-based index of the bit to set.</param>
<param name="value">The Boolean value to assign to the bit.</param>
<summary>Sets the bit at a specific position in the <see cref="T:System.Collections.BitArray" /> to the specified value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is an O(1) operation.
## Examples
The following code example shows how to set and get specific elements in a <xref:System.Collections.BitArray>.
[!code-cpp[Classic BitArray.Get Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic BitArray.Get Example/CPP/source.cpp#1)]
[!code-csharp[Classic BitArray.Get Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Get Example/CS/source.cs#1)]
[!code-vb[Classic BitArray.Get Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic BitArray.Get Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> is less than zero.
-or-
<paramref name="index" /> is greater than or equal to the number of elements in the <see cref="T:System.Collections.BitArray" />.</exception>
</Docs>
</Member>
<Member MemberName="SetAll">
<MemberSignature Language="C#" Value="public void SetAll (bool value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetAll(bool value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.SetAll(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Sub SetAll (value As Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void SetAll(bool value);" />
<MemberSignature Language="F#" Value="member this.SetAll : bool -&gt; unit" Usage="bitArray.SetAll value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="value">The Boolean value to assign to all bits.</param>
<summary>Sets all bits in the <see cref="T:System.Collections.BitArray" /> to the specified value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is an O(`n`) operation, where `n` is <xref:System.Collections.BitArray.Count%2A>.
## Examples
The following code example shows how to set and get specific elements in a <xref:System.Collections.BitArray>.
[!code-cpp[Classic BitArray.Get Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic BitArray.Get Example/CPP/source.cpp#1)]
[!code-csharp[Classic BitArray.Get Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Get Example/CS/source.cs#1)]
[!code-vb[Classic BitArray.Get Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic BitArray.Get Example/VB/source.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="SyncRoot">
<MemberSignature Language="C#" Value="public object SyncRoot { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance object SyncRoot" />
<MemberSignature Language="DocId" Value="P:System.Collections.BitArray.SyncRoot" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property SyncRoot As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ SyncRoot { System::Object ^ get(); };" />
<MemberSignature Language="F#" Value="member this.SyncRoot : obj" Usage="System.Collections.BitArray.SyncRoot" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Collections.ICollection.SyncRoot</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.BitArray" />.</summary>
<value>An object that can be used to synchronize access to the <see cref="T:System.Collections.BitArray" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Derived classes can provide their own synchronized version of the <xref:System.Collections.BitArray> using the <xref:System.Collections.BitArray.SyncRoot%2A> property. The synchronizing code must perform operations on the <xref:System.Collections.BitArray.SyncRoot%2A> of the <xref:System.Collections.BitArray>, not directly on the <xref:System.Collections.BitArray>. This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the <xref:System.Collections.BitArray> object.
Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.
## Examples
The following code example shows how to lock the collection using the <xref:System.Collections.BitArray.SyncRoot%2A> during the entire enumeration.
[!code-cpp[Classic BitArray Example#2](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic BitArray Example/CPP/source2.cpp#2)]
[!code-csharp[Classic BitArray Example#2](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray Example/CS/source2.cs#2)]
[!code-vb[Classic BitArray Example#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic BitArray Example/VB/source2.vb#2)]
Retrieving the value of this property is an O(1) operation.
]]></format>
</remarks>
<altmember cref="P:System.Collections.BitArray.IsSynchronized" />
</Docs>
</Member>
<Member MemberName="System.Collections.ICollection.CopyTo">
<MemberSignature Language="C#" Value="void ICollection.CopyTo (Array array, int index);" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Collections.ICollection.CopyTo(class System.Array array, int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.System#Collections#ICollection#CopyTo(System.Array,System.Int32)" />
<MemberSignature Language="C++ CLI" Value=" virtual void System.Collections.ICollection.CopyTo(Array ^ array, int index) = System::Collections::ICollection::CopyTo;" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Collections.ICollection.CopyTo(System.Array,System.Int32)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="array" Type="System.Array" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6" />
<Parameter Name="index" Type="System.Int32" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6" />
</Parameters>
<Docs>
<param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.BitArray" />. The <see cref="T:System.Array" /> must have zero-based indexing. </param>
<param name="index">The zero-based index in <paramref name="array" /> at which copying begins. </param>
<summary>Copies the elements of the <see cref="T:System.Collections.BitArray" /> to an <see cref="T:System.Array" />, starting at the specified <see cref="T:System.Array" /> index.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="array" /> is null. </exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> is less than zero. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="array" /> is multidimensional.-or- The number of elements in the source <see cref="T:System.Collections.BitArray" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.-or-The type of the source <see cref="T:System.Collections.BitArray" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
</Docs>
</Member>
<Member MemberName="System.Collections.ICollection.Count">
<MemberSignature Language="C#" Value="int System.Collections.ICollection.Count { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 System.Collections.ICollection.Count" />
<MemberSignature Language="DocId" Value="P:System.Collections.BitArray.System#Collections#ICollection#Count" />
<MemberSignature Language="VB.NET" Value=" ReadOnly Property Count As Integer Implements ICollection.Count" />
<MemberSignature Language="C++ CLI" Value="property int System::Collections::ICollection::Count { int get(); };" />
<MemberSignature Language="F#" Usage="System.Collections.ICollection.Count" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Collections.ICollection.Count</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the number of elements in the <see cref="T:System.Collections.BitArray" />.</summary>
<value>The number of elements in the <see cref="T:System.Collections.BitArray" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="System.Collections.ICollection.IsSynchronized">
<MemberSignature Language="C#" Value="bool System.Collections.ICollection.IsSynchronized { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool System.Collections.ICollection.IsSynchronized" />
<MemberSignature Language="DocId" Value="P:System.Collections.BitArray.System#Collections#ICollection#IsSynchronized" />
<MemberSignature Language="VB.NET" Value=" ReadOnly Property IsSynchronized As Boolean Implements ICollection.IsSynchronized" />
<MemberSignature Language="C++ CLI" Value="property bool System::Collections::ICollection::IsSynchronized { bool get(); };" />
<MemberSignature Language="F#" Usage="System.Collections.ICollection.IsSynchronized" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Collections.ICollection.IsSynchronized</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value that indicates whether access to the <see cref="T:System.Collections.BitArray" /> is synchronized (thread safe).</summary>
<value>true if access to the <see cref="T:System.Collections.BitArray" /> is synchronized (thread safe); otherwise, false.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="System.Collections.ICollection.SyncRoot">
<MemberSignature Language="C#" Value="object System.Collections.ICollection.SyncRoot { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance object System.Collections.ICollection.SyncRoot" />
<MemberSignature Language="DocId" Value="P:System.Collections.BitArray.System#Collections#ICollection#SyncRoot" />
<MemberSignature Language="VB.NET" Value=" ReadOnly Property SyncRoot As Object Implements ICollection.SyncRoot" />
<MemberSignature Language="C++ CLI" Value="property System::Object ^ System::Collections::ICollection::SyncRoot { System::Object ^ get(); };" />
<MemberSignature Language="F#" Usage="System.Collections.ICollection.SyncRoot" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Collections.ICollection.SyncRoot</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.BitArray" />.</summary>
<value>An object that can be used to synchronize access to the <see cref="T:System.Collections.BitArray" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Xor">
<MemberSignature Language="C#" Value="public System.Collections.BitArray Xor (System.Collections.BitArray value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Collections.BitArray Xor(class System.Collections.BitArray value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.BitArray.Xor(System.Collections.BitArray)" />
<MemberSignature Language="VB.NET" Value="Public Function Xor (value As BitArray) As BitArray" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Collections::BitArray ^ Xor(System::Collections::BitArray ^ value);" />
<MemberSignature Language="F#" Value="member this.Xor : System.Collections.BitArray -&gt; System.Collections.BitArray" Usage="bitArray.Xor value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.BitArray</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Collections.BitArray" />
</Parameters>
<Docs>
<param name="value">The array with which to perform the bitwise exclusive OR operation.</param>
<summary>Performs the bitwise exclusive OR operation between the elements of the current <see cref="T:System.Collections.BitArray" /> object against the corresponding elements in the specified array. The current <see cref="T:System.Collections.BitArray" /> object will be modified to store the result of the bitwise exclusive OR operation.</summary>
<returns>An array containing the result of the bitwise exclusive OR operation, which is a reference to the current <see cref="T:System.Collections.BitArray" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The bitwise exclusive OR operation returns `true` if exactly one operand is `true`, and returns `false` if both operands have the same Boolean value.
This method is an O(`n`) operation, where `n` is <xref:System.Collections.BitArray.Count%2A>.
## Examples
The following code example shows how to perform the XOR operation between two <xref:System.Collections.BitArray> objects.
[!code-cpp[Classic BitArray.Xor Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic BitArray.Xor Example/CPP/source.cpp#1)]
[!code-csharp[Classic BitArray.Xor Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Xor Example/CS/source.cs#1)]
[!code-vb[Classic BitArray.Xor Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic BitArray.Xor Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="value" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="value" /> and the current <see cref="T:System.Collections.BitArray" /> do not have the same number of elements.</exception>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.