Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
1778 lines (1597 sloc) 124 KB
<Type Name="NameObjectCollectionBase" FullName="System.Collections.Specialized.NameObjectCollectionBase">
<TypeSignature Language="C#" Value="public abstract class NameObjectCollectionBase : System.Collections.ICollection, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract serializable beforefieldinit NameObjectCollectionBase extends System.Object implements class System.Collections.ICollection, class System.Collections.IEnumerable, class System.Runtime.Serialization.IDeserializationCallback, class System.Runtime.Serialization.ISerializable" />
<TypeSignature Language="DocId" Value="T:System.Collections.Specialized.NameObjectCollectionBase" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class NameObjectCollectionBase&#xA;Implements ICollection, IDeserializationCallback, ISerializable" />
<TypeSignature Language="C++ CLI" Value="public ref class NameObjectCollectionBase abstract : System::Collections::ICollection, System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable" />
<TypeSignature Language="F#" Value="type NameObjectCollectionBase = class&#xA; interface ICollection&#xA; interface ISerializable&#xA; interface IDeserializationCallback&#xA; interface IEnumerable" />
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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.Runtime.Serialization.IDeserializationCallback</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<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>Provides the <see langword="abstract" /> base class for a collection of associated <see cref="T:System.String" /> keys and <see cref="T:System.Object" /> values that can be accessed either with the key or with the index.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The underlying structure for this class is a hash table.
Each element is a key/value pair.
The capacity of a <xref:System.Collections.Specialized.NameObjectCollectionBase> is the number of elements the <xref:System.Collections.Specialized.NameObjectCollectionBase> can hold. As elements are added to a <xref:System.Collections.Specialized.NameObjectCollectionBase>, the capacity is automatically increased as required through reallocation.
The hash code provider dispenses hash codes for keys in the <xref:System.Collections.Specialized.NameObjectCollectionBase> instance. The default hash code provider is the <xref:System.Collections.CaseInsensitiveHashCodeProvider>.
The comparer determines whether two keys are equal. The default comparer is the <xref:System.Collections.CaseInsensitiveComparer>.
In .NET Framework version 1.0, this class uses culture-sensitive string comparisons. However, in .NET Framework version 1.1 and later, this class uses <xref:System.Globalization.CultureInfo.InvariantCulture%2A?displayProperty=nameWithType> when comparing strings. For more information about how culture affects comparisons and sorting, see [Performing Culture-Insensitive String Operations](~/docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md).
`null` is allowed as a key or as a value.
> [!CAUTION]
> The <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseGet%2A> method does not distinguish between `null` which is returned because the specified key is not found and `null` which is returned because the value associated with the key is `null`.
## Examples
The following code example shows how to implement and use the <xref:System.Collections.Specialized.NameObjectCollectionBase> class.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CPP/nameobjectcollectionbase.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/nameobjectcollectionbase.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/VB/nameobjectcollectionbase.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.Specialized.NameObjectCollectionBase" />, but derived classes can create their own synchronized versions of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> using the <see cref="P:System.Collections.ICollection.SyncRoot" /> property.
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.Hashtable" />
<altmember cref="T:System.Collections.Specialized.NameValueCollection" />
<altmember cref="T:System.String" />
<related type="Article" href="~/docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md">Performing Culture-Insensitive String Operations</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected NameObjectCollectionBase ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.#ctor" />
<MemberSignature Language="VB.NET" Value="Protected Sub New ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; NameObjectCollectionBase();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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 />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is empty.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The capacity of a <xref:System.Collections.Specialized.NameObjectCollectionBase> is the number of elements that the <xref:System.Collections.Specialized.NameObjectCollectionBase> can hold. As elements are added to a <xref:System.Collections.Specialized.NameObjectCollectionBase>, the capacity is automatically increased as required by reallocating the internal array.
If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the <xref:System.Collections.Specialized.NameObjectCollectionBase>.
The hash code provider dispenses hash codes for keys in the <xref:System.Collections.Specialized.NameObjectCollectionBase> instance. The default hash code provider is the <xref:System.Collections.CaseInsensitiveHashCodeProvider>.
The comparer determines whether two keys are equal. The default comparer is the <xref:System.Collections.CaseInsensitiveComparer>.
This constructor is an O(1) operation.
]]></format>
</remarks>
<altmember cref="T:System.Collections.CaseInsensitiveHashCodeProvider" />
<altmember cref="T:System.Collections.CaseInsensitiveComparer" />
<related type="Article" href="~/docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md">Performing Culture-Insensitive String Operations</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected NameObjectCollectionBase (System.Collections.IEqualityComparer equalityComparer);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Collections.IEqualityComparer equalityComparer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.#ctor(System.Collections.IEqualityComparer)" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (equalityComparer As IEqualityComparer)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; NameObjectCollectionBase(System::Collections::IEqualityComparer ^ equalityComparer);" />
<MemberSignature Language="F#" Value="new System.Collections.Specialized.NameObjectCollectionBase : System.Collections.IEqualityComparer -&gt; System.Collections.Specialized.NameObjectCollectionBase" Usage="new System.Collections.Specialized.NameObjectCollectionBase equalityComparer" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<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="equalityComparer" Type="System.Collections.IEqualityComparer" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;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;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="equalityComparer">The <see cref="T:System.Collections.IEqualityComparer" /> object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is empty, has the default initial capacity, and uses the specified <see cref="T:System.Collections.IEqualityComparer" /> object.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The capacity of a <xref:System.Collections.Specialized.NameObjectCollectionBase> object is the number of elements that the <xref:System.Collections.Specialized.NameObjectCollectionBase> can hold. As elements are added to a <xref:System.Collections.Specialized.NameObjectCollectionBase>, the capacity is automatically increased as required by reallocating the internal array.
If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the <xref:System.Collections.Specialized.NameObjectCollectionBase>.
The <xref:System.Collections.IEqualityComparer> object combines the comparer and the hash code provider. The hash code provider dispenses hash codes for keys in the <xref:System.Collections.Specialized.NameObjectCollectionBase>. The comparer determines whether two keys are equal.
This constructor is an O(1) operation.
]]></format>
</remarks>
<altmember cref="T:System.Collections.IEqualityComparer" />
<related type="Article" href="~/docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md">Performing Culture-Insensitive String Operations</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected NameObjectCollectionBase (int capacity);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(int32 capacity) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.#ctor(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (capacity As Integer)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; NameObjectCollectionBase(int capacity);" />
<MemberSignature Language="F#" Value="new System.Collections.Specialized.NameObjectCollectionBase : int -&gt; System.Collections.Specialized.NameObjectCollectionBase" Usage="new System.Collections.Specialized.NameObjectCollectionBase capacity" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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="capacity" Type="System.Int32" />
</Parameters>
<Docs>
<param name="capacity">The approximate number of entries that the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance can initially contain.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is empty, has the specified initial capacity, and uses the default hash code provider and the default comparer.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The capacity of a <xref:System.Collections.Specialized.NameObjectCollectionBase> is the number of elements that the <xref:System.Collections.Specialized.NameObjectCollectionBase> can hold. As elements are added to a <xref:System.Collections.Specialized.NameObjectCollectionBase>, the capacity is automatically increased as required by reallocating the internal array.
If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the <xref:System.Collections.Specialized.NameObjectCollectionBase>.
The hash code provider dispenses hash codes for keys in the <xref:System.Collections.Specialized.NameObjectCollectionBase> instance. The default hash code provider is the <xref:System.Collections.CaseInsensitiveHashCodeProvider>.
The comparer determines whether two keys are equal. The default comparer is the <xref:System.Collections.CaseInsensitiveComparer>.
This constructor is an O(`n`) operation, where `n` is `capacity`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="capacity" /> is less than zero.</exception>
<altmember cref="T:System.Collections.CaseInsensitiveHashCodeProvider" />
<altmember cref="T:System.Collections.CaseInsensitiveComparer" />
<related type="Article" href="~/docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md">Performing Culture-Insensitive String Operations</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected NameObjectCollectionBase (System.Collections.IHashCodeProvider hashProvider, System.Collections.IComparer comparer);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Collections.IHashCodeProvider hashProvider, class System.Collections.IComparer comparer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.#ctor(System.Collections.IHashCodeProvider,System.Collections.IComparer)" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (hashProvider As IHashCodeProvider, comparer As IComparer)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; NameObjectCollectionBase(System::Collections::IHashCodeProvider ^ hashProvider, System::Collections::IComparer ^ comparer);" />
<MemberSignature Language="F#" Value="new System.Collections.Specialized.NameObjectCollectionBase : System.Collections.IHashCodeProvider * System.Collections.IComparer -&gt; System.Collections.Specialized.NameObjectCollectionBase" Usage="new System.Collections.Specialized.NameObjectCollectionBase (hashProvider, comparer)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System</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.Specialized</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.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;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;netcore-3.0;netstandard-2.1">
<AttributeName>System.Obsolete("Please use NameObjectCollectionBase(IEqualityComparer) instead.")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="hashProvider" Type="System.Collections.IHashCodeProvider" 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="comparer" Type="System.Collections.IComparer" 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="hashProvider">The <see cref="T:System.Collections.IHashCodeProvider" /> that will supply the hash codes for all keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</param>
<param name="comparer">The <see cref="T:System.Collections.IComparer" /> to use to determine whether two keys are equal.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is empty, has the default initial capacity, and uses the specified hash code provider and the specified comparer.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The capacity of a <xref:System.Collections.Specialized.NameObjectCollectionBase> is the number of elements that the <xref:System.Collections.Specialized.NameObjectCollectionBase> can hold. As elements are added to a <xref:System.Collections.Specialized.NameObjectCollectionBase>, the capacity is automatically increased as required by reallocating the internal array.
If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the <xref:System.Collections.Specialized.NameObjectCollectionBase>.
The hash code provider dispenses hash codes for keys in the <xref:System.Collections.Specialized.NameObjectCollectionBase> instance. The default hash code provider is the <xref:System.Collections.CaseInsensitiveHashCodeProvider>.
The comparer determines whether two keys are equal. The default comparer is the <xref:System.Collections.CaseInsensitiveComparer>.
This constructor is an O(1) operation.
]]></format>
</remarks>
<altmember cref="T:System.Collections.IHashCodeProvider" />
<altmember cref="T:System.Collections.IComparer" />
<altmember cref="T:System.Collections.CaseInsensitiveHashCodeProvider" />
<altmember cref="T:System.Collections.CaseInsensitiveComparer" />
<related type="Article" href="~/docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md">Performing Culture-Insensitive String Operations</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected NameObjectCollectionBase (int capacity, System.Collections.IEqualityComparer equalityComparer);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(int32 capacity, class System.Collections.IEqualityComparer equalityComparer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.#ctor(System.Int32,System.Collections.IEqualityComparer)" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (capacity As Integer, equalityComparer As IEqualityComparer)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; NameObjectCollectionBase(int capacity, System::Collections::IEqualityComparer ^ equalityComparer);" />
<MemberSignature Language="F#" Value="new System.Collections.Specialized.NameObjectCollectionBase : int * System.Collections.IEqualityComparer -&gt; System.Collections.Specialized.NameObjectCollectionBase" Usage="new System.Collections.Specialized.NameObjectCollectionBase (capacity, equalityComparer)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<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="capacity" Type="System.Int32" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;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;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="equalityComparer" Type="System.Collections.IEqualityComparer" Index="1" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;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;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="capacity">The approximate number of entries that the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> object can initially contain.</param>
<param name="equalityComparer">The <see cref="T:System.Collections.IEqualityComparer" /> object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is empty, has the specified initial capacity, and uses the specified <see cref="T:System.Collections.IEqualityComparer" /> object.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The capacity of a <xref:System.Collections.Specialized.NameObjectCollectionBase> object is the number of elements that the <xref:System.Collections.Specialized.NameObjectCollectionBase> can hold. As elements are added to a <xref:System.Collections.Specialized.NameObjectCollectionBase>, the capacity is automatically increased as required by reallocating the internal array.
If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the <xref:System.Collections.Specialized.NameObjectCollectionBase>.
The <xref:System.Collections.IEqualityComparer> object combines the comparer and the hash code provider. The hash code provider dispenses hash codes for keys in the <xref:System.Collections.Specialized.NameObjectCollectionBase>. The comparer determines whether two keys are equal.
This constructor is an O(`n`) operation, where `n` is the `capacity` parameter.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="capacity" /> is less than zero.</exception>
<altmember cref="T:System.Collections.IEqualityComparer" />
<related type="Article" href="~/docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md">Performing Culture-Insensitive String Operations</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected NameObjectCollectionBase (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (info As SerializationInfo, context As StreamingContext)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; NameObjectCollectionBase(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);" />
<MemberSignature Language="F#" Value="new System.Collections.Specialized.NameObjectCollectionBase : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -&gt; System.Collections.Specialized.NameObjectCollectionBase" Usage="new System.Collections.Specialized.NameObjectCollectionBase (info, context)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System</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.Specialized</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.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>
<Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" 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="context" Type="System.Runtime.Serialization.StreamingContext" 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="info">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object that contains the information required to serialize the new <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</param>
<param name="context">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> object that contains the source and destination of the serialized stream associated with the new <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is serializable and uses the specified <see cref="T:System.Runtime.Serialization.SerializationInfo" /> and <see cref="T:System.Runtime.Serialization.StreamingContext" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor is an O(1) operation.
]]></format>
</remarks>
<altmember cref="T:System.Runtime.Serialization.ISerializable" />
<altmember cref="T:System.Runtime.Serialization.SerializationInfo" />
<altmember cref="T:System.Runtime.Serialization.StreamingContext" />
<related type="Article" href="~/docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md">Performing Culture-Insensitive String Operations</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected NameObjectCollectionBase (int capacity, System.Collections.IHashCodeProvider hashProvider, System.Collections.IComparer comparer);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(int32 capacity, class System.Collections.IHashCodeProvider hashProvider, class System.Collections.IComparer comparer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.#ctor(System.Int32,System.Collections.IHashCodeProvider,System.Collections.IComparer)" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (capacity As Integer, hashProvider As IHashCodeProvider, comparer As IComparer)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; NameObjectCollectionBase(int capacity, System::Collections::IHashCodeProvider ^ hashProvider, System::Collections::IComparer ^ comparer);" />
<MemberSignature Language="F#" Value="new System.Collections.Specialized.NameObjectCollectionBase : int * System.Collections.IHashCodeProvider * System.Collections.IComparer -&gt; System.Collections.Specialized.NameObjectCollectionBase" Usage="new System.Collections.Specialized.NameObjectCollectionBase (capacity, hashProvider, comparer)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System</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.Specialized</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.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;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;netcore-3.0;netstandard-2.1">
<AttributeName>System.Obsolete("Please use NameObjectCollectionBase(Int32, IEqualityComparer) instead.")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="capacity" Type="System.Int32" 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="hashProvider" Type="System.Collections.IHashCodeProvider" 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" />
<Parameter Name="comparer" Type="System.Collections.IComparer" Index="2" 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="capacity">The approximate number of entries that the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance can initially contain.</param>
<param name="hashProvider">The <see cref="T:System.Collections.IHashCodeProvider" /> that will supply the hash codes for all keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</param>
<param name="comparer">The <see cref="T:System.Collections.IComparer" /> to use to determine whether two keys are equal.</param>
<summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> class that is empty, has the specified initial capacity and uses the specified hash code provider and the specified comparer.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The capacity of a <xref:System.Collections.Specialized.NameObjectCollectionBase> is the number of elements that the <xref:System.Collections.Specialized.NameObjectCollectionBase> can hold. As elements are added to a <xref:System.Collections.Specialized.NameObjectCollectionBase>, the capacity is automatically increased as required by reallocating the internal array.
If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the <xref:System.Collections.Specialized.NameObjectCollectionBase>.
The hash code provider dispenses hash codes for keys in the <xref:System.Collections.Specialized.NameObjectCollectionBase> instance. The default hash code provider is the <xref:System.Collections.CaseInsensitiveHashCodeProvider>.
The comparer determines whether two keys are equal. The default comparer is the <xref:System.Collections.CaseInsensitiveComparer>.
This constructor is an O(`n`) operation, where `n` is `capacity`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="capacity" /> is less than zero.</exception>
<altmember cref="T:System.Collections.IHashCodeProvider" />
<altmember cref="T:System.Collections.CaseInsensitiveHashCodeProvider" />
<altmember cref="T:System.Collections.IComparer" />
<altmember cref="T:System.Collections.CaseInsensitiveComparer" />
<related type="Article" href="~/docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md">Performing Culture-Insensitive String Operations</related>
</Docs>
</Member>
<Member MemberName="BaseAdd">
<MemberSignature Language="C#" Value="protected void BaseAdd (string name, object value);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance void BaseAdd(string name, object value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseAdd(System.String,System.Object)" />
<MemberSignature Language="VB.NET" Value="Protected Sub BaseAdd (name As String, value As Object)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; void BaseAdd(System::String ^ name, System::Object ^ value);" />
<MemberSignature Language="F#" Value="member this.BaseAdd : string * obj -&gt; unit" Usage="nameObjectCollectionBase.BaseAdd (name, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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="name" Type="System.String" />
<Parameter Name="value" Type="System.Object" />
</Parameters>
<Docs>
<param name="name">The <see cref="T:System.String" /> key of the entry to add. The key can be <see langword="null" />.</param>
<param name="value">The <see cref="T:System.Object" /> value of the entry to add. The value can be <see langword="null" />.</param>
<summary>Adds an entry with the specified key and value into the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A> already equals the capacity, the capacity of the <xref:System.Collections.Specialized.NameObjectCollectionBase> is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added.
If <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A> is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A>.
## Examples
The following code example uses <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseAdd%2A> to create a new <xref:System.Collections.Specialized.NameObjectCollectionBase> with elements from an <xref:System.Collections.IDictionary>.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.BaseAdd#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseAdd/CPP/nocb_baseadd.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.BaseAdd#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseAdd/CS/nocb_baseadd.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.BaseAdd#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseAdd/VB/nocb_baseadd.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
</Docs>
</Member>
<Member MemberName="BaseClear">
<MemberSignature Language="C#" Value="protected void BaseClear ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance void BaseClear() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseClear" />
<MemberSignature Language="VB.NET" Value="Protected Sub BaseClear ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; void BaseClear();" />
<MemberSignature Language="F#" Value="member this.BaseClear : unit -&gt; unit" Usage="nameObjectCollectionBase.BaseClear " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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 />
<Docs>
<summary>Removes all entries from the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A> is set to zero, and references to other objects from elements of the collection are also released.
This method is an O(1) operation.
## Examples
The following code example uses <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseClear%2A> to remove all elements from a <xref:System.Collections.Specialized.NameObjectCollectionBase>.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.BaseClear#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseClear/CPP/nocb_baseclear.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.BaseClear#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseClear/CS/nocb_baseclear.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.BaseClear#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseClear/VB/nocb_baseclear.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
</Docs>
</Member>
<MemberGroup MemberName="BaseGet">
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Gets the value of the specified entry from the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
</Docs>
</MemberGroup>
<Member MemberName="BaseGet">
<MemberSignature Language="C#" Value="protected object BaseGet (int index);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance object BaseGet(int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseGet(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Function BaseGet (index As Integer) As Object" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; System::Object ^ BaseGet(int index);" />
<MemberSignature Language="F#" Value="member this.BaseGet : int -&gt; obj" Usage="nameObjectCollectionBase.BaseGet index" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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.Object</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 entry at the specified index of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<returns>An <see cref="T:System.Object" /> that represents the value of the entry at the specified index.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is an O(1) operation.
## Examples
The following code example uses <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseGetKey%2A> and <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseGet%2A> to get specific keys and values.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.BaseGet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGet/CPP/nocb_baseget.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.BaseGet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGet/CS/nocb_baseget.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.BaseGet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGet/VB/nocb_baseget.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> is outside the valid range of indexes for the collection.</exception>
</Docs>
</Member>
<Member MemberName="BaseGet">
<MemberSignature Language="C#" Value="protected object BaseGet (string name);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance object BaseGet(string name) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseGet(System.String)" />
<MemberSignature Language="VB.NET" Value="Protected Function BaseGet (name As String) As Object" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; System::Object ^ BaseGet(System::String ^ name);" />
<MemberSignature Language="F#" Value="member this.BaseGet : string -&gt; obj" Usage="nameObjectCollectionBase.BaseGet name" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
</Parameters>
<Docs>
<param name="name">The <see cref="T:System.String" /> key of the entry to get. The key can be <see langword="null" />.</param>
<summary>Gets the value of the first entry with the specified key from the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<returns>An <see cref="T:System.Object" /> that represents the value of the first entry with the specified key, if found; otherwise, <see langword="null" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the collection contains multiple entries with the specified key, this method returns only the first entry. To get the values of subsequent entries with the same key, use the enumerator to iterate through the collection and compare the keys.
> [!CAUTION]
> This method returns `null` in the following cases: 1) if the specified key is not found; and 2) if the specified key is found and its associated value is `null`. This method does not distinguish between the two cases.
This method is an O(1) operation.
## Examples
The following code example uses <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseGetKey%2A> and <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseGet%2A> to get specific keys and values.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.BaseGet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGet/CPP/nocb_baseget.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.BaseGet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGet/CS/nocb_baseget.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.BaseGet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGet/VB/nocb_baseget.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Collections.Specialized.NameObjectCollectionBase.GetEnumerator" />
</Docs>
</Member>
<Member MemberName="BaseGetAllKeys">
<MemberSignature Language="C#" Value="protected string[] BaseGetAllKeys ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance string[] BaseGetAllKeys() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseGetAllKeys" />
<MemberSignature Language="VB.NET" Value="Protected Function BaseGetAllKeys () As String()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; cli::array &lt;System::String ^&gt; ^ BaseGetAllKeys();" />
<MemberSignature Language="F#" Value="member this.BaseGetAllKeys : unit -&gt; string[]" Usage="nameObjectCollectionBase.BaseGetAllKeys " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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.String[]</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns a <see cref="T:System.String" /> array that contains all the keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<returns>A <see cref="T:System.String" /> array that contains all the keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is an O(`n`) operation, where `n` is <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A>.
## Examples
The following code example uses <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseGetAllKeys%2A> and <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseGetAllValues%2A> to get an array of the keys or an array of the values.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.BaseGetAll#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGetAll/CPP/nocb_basegetall.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.BaseGetAll#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGetAll/CS/nocb_basegetall.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.BaseGetAll#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGetAll/VB/nocb_basegetall.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="BaseGetAllValues">
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Returns an array that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
</Docs>
</MemberGroup>
<Member MemberName="BaseGetAllValues">
<MemberSignature Language="C#" Value="protected object[] BaseGetAllValues ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance object[] BaseGetAllValues() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseGetAllValues" />
<MemberSignature Language="VB.NET" Value="Protected Function BaseGetAllValues () As Object()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; cli::array &lt;System::Object ^&gt; ^ BaseGetAllValues();" />
<MemberSignature Language="F#" Value="member this.BaseGetAllValues : unit -&gt; obj[]" Usage="nameObjectCollectionBase.BaseGetAllValues " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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.Object[]</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns an <see cref="T:System.Object" /> array that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<returns>An <see cref="T:System.Object" /> array that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is an O(`n`) operation, where `n` is <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A>.
## Examples
The following code example uses <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseGetAllKeys%2A> and <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseGetAllValues%2A> to get an array of the keys or an array of the values.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.BaseGetAll#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGetAll/CPP/nocb_basegetall.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.BaseGetAll#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGetAll/CS/nocb_basegetall.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.BaseGetAll#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGetAll/VB/nocb_basegetall.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BaseGetAllValues">
<MemberSignature Language="C#" Value="protected object[] BaseGetAllValues (Type type);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance object[] BaseGetAllValues(class System.Type type) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseGetAllValues(System.Type)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; cli::array &lt;System::Object ^&gt; ^ BaseGetAllValues(Type ^ type);" />
<MemberSignature Language="F#" Value="member this.BaseGetAllValues : Type -&gt; obj[]" Usage="nameObjectCollectionBase.BaseGetAllValues type" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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.Object[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="type" Type="System.Type" />
</Parameters>
<Docs>
<param name="type">A <see cref="T:System.Type" /> that represents the type of array to return.</param>
<summary>Returns an array of the specified type that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<returns>An array of the specified type that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is an O(`n`) operation, where `n` is <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="type" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="type" /> is not a valid <see cref="T:System.Type" />.</exception>
<altmember cref="T:System.Type" />
</Docs>
</Member>
<Member MemberName="BaseGetKey">
<MemberSignature Language="C#" Value="protected string BaseGetKey (int index);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance string BaseGetKey(int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseGetKey(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Function BaseGetKey (index As Integer) As String" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; System::String ^ BaseGetKey(int index);" />
<MemberSignature Language="F#" Value="member this.BaseGetKey : int -&gt; string" Usage="nameObjectCollectionBase.BaseGetKey index" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<param name="index">The zero-based index of the key to get.</param>
<summary>Gets the key of the entry at the specified index of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<returns>A <see cref="T:System.String" /> that represents the key of the entry at the specified index.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is an O(1) operation.
## Examples
The following code example uses <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseGetKey%2A> and <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseGet%2A> to get specific keys and values.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.BaseGet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGet/CPP/nocb_baseget.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.BaseGet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGet/CS/nocb_baseget.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.BaseGet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGet/VB/nocb_baseget.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> is outside the valid range of indexes for the collection.</exception>
</Docs>
</Member>
<Member MemberName="BaseHasKeys">
<MemberSignature Language="C#" Value="protected bool BaseHasKeys ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance bool BaseHasKeys() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseHasKeys" />
<MemberSignature Language="VB.NET" Value="Protected Function BaseHasKeys () As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; bool BaseHasKeys();" />
<MemberSignature Language="F#" Value="member this.BaseHasKeys : unit -&gt; bool" Usage="nameObjectCollectionBase.BaseHasKeys " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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 />
<Docs>
<summary>Gets a value indicating whether the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance contains entries whose keys are not <see langword="null" />.</summary>
<returns>
<see langword="true" /> if the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance contains entries whose keys are not <see langword="null" />; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is an O(1) operation.
## Examples
The following code example uses <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseHasKeys%2A> to determine if the collection contains keys that are not `null`.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.BaseHasKeys#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseHasKeys/CPP/nocb_basehaskeys.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.BaseHasKeys#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseHasKeys/CS/nocb_basehaskeys.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.BaseHasKeys#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseHasKeys/VB/nocb_basehaskeys.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BaseRemove">
<MemberSignature Language="C#" Value="protected void BaseRemove (string name);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance void BaseRemove(string name) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseRemove(System.String)" />
<MemberSignature Language="VB.NET" Value="Protected Sub BaseRemove (name As String)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; void BaseRemove(System::String ^ name);" />
<MemberSignature Language="F#" Value="member this.BaseRemove : string -&gt; unit" Usage="nameObjectCollectionBase.BaseRemove name" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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="name" Type="System.String" />
</Parameters>
<Docs>
<param name="name">The <see cref="T:System.String" /> key of the entries to remove. The key can be <see langword="null" />.</param>
<summary>Removes the entries with the specified key from the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the <xref:System.Collections.Specialized.NameObjectCollectionBase> does not contain an element with the specified key, the <xref:System.Collections.Specialized.NameObjectCollectionBase> remains unchanged. No exception is thrown.
In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table.
This method is an O(`n`) operation, where `n` is <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A>.
## Examples
The following code example uses <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseRemove%2A> and <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseRemoveAt%2A> to remove elements from a <xref:System.Collections.Specialized.NameObjectCollectionBase>.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.BaseRemove#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseRemove/CPP/nocb_baseremove.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.BaseRemove#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseRemove/CS/nocb_baseremove.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.BaseRemove#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseRemove/VB/nocb_baseremove.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
<related type="Article" href="~/docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md">Performing Culture-Insensitive String Operations</related>
</Docs>
</Member>
<Member MemberName="BaseRemoveAt">
<MemberSignature Language="C#" Value="protected void BaseRemoveAt (int index);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance void BaseRemoveAt(int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseRemoveAt(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Sub BaseRemoveAt (index As Integer)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; void BaseRemoveAt(int index);" />
<MemberSignature Language="F#" Value="member this.BaseRemoveAt : int -&gt; unit" Usage="nameObjectCollectionBase.BaseRemoveAt index" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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" />
</Parameters>
<Docs>
<param name="index">The zero-based index of the entry to remove.</param>
<summary>Removes the entry at the specified index of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table.
This method is an O(`n`) operation, where `n` is <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A>.
## Examples
The following code example uses <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseRemove%2A> and <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseRemoveAt%2A> to remove elements from a <xref:System.Collections.Specialized.NameObjectCollectionBase>.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.BaseRemove#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseRemove/CPP/nocb_baseremove.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.BaseRemove#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseRemove/CS/nocb_baseremove.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.BaseRemove#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseRemove/VB/nocb_baseremove.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> is outside the valid range of indexes for the collection.</exception>
<exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
</Docs>
</Member>
<MemberGroup MemberName="BaseSet">
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Sets the value of an entry in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
</Docs>
</MemberGroup>
<Member MemberName="BaseSet">
<MemberSignature Language="C#" Value="protected void BaseSet (int index, object value);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance void BaseSet(int32 index, object value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseSet(System.Int32,System.Object)" />
<MemberSignature Language="VB.NET" Value="Protected Sub BaseSet (index As Integer, value As Object)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; void BaseSet(int index, System::Object ^ value);" />
<MemberSignature Language="F#" Value="member this.BaseSet : int * obj -&gt; unit" Usage="nameObjectCollectionBase.BaseSet (index, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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.Object" />
</Parameters>
<Docs>
<param name="index">The zero-based index of the entry to set.</param>
<param name="value">The <see cref="T:System.Object" /> that represents the new value of the entry to set. The value can be <see langword="null" />.</param>
<summary>Sets the value of the entry at the specified index of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is an O(1) operation.
## Examples
The following code example uses <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseSet%2A> to set the value of a specific element.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.BaseSet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseSet/CPP/nocb_baseset.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.BaseSet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseSet/CS/nocb_baseset.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.BaseSet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseSet/VB/nocb_baseset.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> is outside the valid range of indexes for the collection.</exception>
<related type="Article" href="~/docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md">Performing Culture-Insensitive String Operations</related>
</Docs>
</Member>
<Member MemberName="BaseSet">
<MemberSignature Language="C#" Value="protected void BaseSet (string name, object value);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance void BaseSet(string name, object value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.BaseSet(System.String,System.Object)" />
<MemberSignature Language="VB.NET" Value="Protected Sub BaseSet (name As String, value As Object)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; void BaseSet(System::String ^ name, System::Object ^ value);" />
<MemberSignature Language="F#" Value="member this.BaseSet : string * obj -&gt; unit" Usage="nameObjectCollectionBase.BaseSet (name, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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="name" Type="System.String" />
<Parameter Name="value" Type="System.Object" />
</Parameters>
<Docs>
<param name="name">The <see cref="T:System.String" /> key of the entry to set. The key can be <see langword="null" />.</param>
<param name="value">The <see cref="T:System.Object" /> that represents the new value of the entry to set. The value can be <see langword="null" />.</param>
<summary>Sets the value of the first entry with the specified key in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance, if found; otherwise, adds an entry with the specified key and value into the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the collection contains multiple entries with the specified key, this method sets only the first entry. To set the values of subsequent entries with the same key, use the enumerator to iterate through the collection and compare the keys.
This method is an O(1) operation.
## Examples
The following code example uses <xref:System.Collections.Specialized.NameObjectCollectionBase.BaseSet%2A> to set the value of a specific element.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.BaseSet#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseSet/CPP/nocb_baseset.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.BaseSet#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseSet/CS/nocb_baseset.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.BaseSet#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseSet/VB/nocb_baseset.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
<altmember cref="M:System.Collections.Specialized.NameObjectCollectionBase.GetEnumerator" />
<related type="Article" href="~/docs/standard/globalization-localization/performing-culture-insensitive-string-operations.md">Performing Culture-Insensitive String Operations</related>
</Docs>
</Member>
<Member MemberName="Count">
<MemberSignature Language="C#" Value="public virtual int Count { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Count" />
<MemberSignature Language="DocId" Value="P:System.Collections.Specialized.NameObjectCollectionBase.Count" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property Count As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property int Count { int get(); };" />
<MemberSignature Language="F#" Value="member this.Count : int" Usage="System.Collections.Specialized.NameObjectCollectionBase.Count" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Collections.ICollection.Count</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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 the number of key/value pairs contained in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<value>The number of key/value pairs contained in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The capacity is the number of elements that the <xref:System.Collections.Specialized.NameObjectCollectionBase> can store. <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A> is the number of elements that are actually in the <xref:System.Collections.Specialized.NameObjectCollectionBase>.
The capacity is always greater than or equal to <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A>. If <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A> exceeds the capacity while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements.
Retrieving the value of this property is an O(1) operation.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetEnumerator">
<MemberSignature Language="C#" Value="public virtual 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.Specialized.NameObjectCollectionBase.GetEnumerator" />
<MemberSignature Language="VB.NET" Value="Public Overridable 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="nameObjectCollectionBase.GetEnumerator " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Collections.IEnumerable.GetEnumerator</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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.Specialized.NameObjectCollectionBase" />.</summary>
<returns>An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This enumerator returns the keys of the collection as strings.
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>
</Docs>
</Member>
<Member MemberName="GetObjectData">
<MemberSignature Language="C#" Value="public virtual void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void GetObjectData(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub GetObjectData (info As SerializationInfo, context As StreamingContext)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void GetObjectData(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);" />
<MemberSignature Language="F#" Value="abstract member GetObjectData : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -&gt; unit&#xA;override this.GetObjectData : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -&gt; unit" Usage="nameObjectCollectionBase.GetObjectData (info, context)" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System</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.Specialized</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" 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="context" Type="System.Runtime.Serialization.StreamingContext" 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="info">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object that contains the information required to serialize the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</param>
<param name="context">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> object that contains the source and destination of the serialized stream associated with the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</param>
<summary>Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and returns the data needed to serialize the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is an O(`n`) operation, where `n` is <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="info" /> is <see langword="null" />.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for providing serialization services. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter" /> Security action: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" /></permission>
<altmember cref="T:System.Runtime.Serialization.ISerializable" />
<altmember cref="T:System.Runtime.Serialization.SerializationInfo" />
<altmember cref="T:System.Runtime.Serialization.StreamingContext" />
</Docs>
</Member>
<Member MemberName="IsReadOnly">
<MemberSignature Language="C#" Value="protected bool IsReadOnly { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsReadOnly" />
<MemberSignature Language="DocId" Value="P:System.Collections.Specialized.NameObjectCollectionBase.IsReadOnly" />
<MemberSignature Language="VB.NET" Value="Protected Property IsReadOnly As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; property bool IsReadOnly { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.IsReadOnly : bool with get, set" Usage="System.Collections.Specialized.NameObjectCollectionBase.IsReadOnly" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance is read-only.</summary>
<value>
<see langword="true" /> if the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance is read-only; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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.
Retrieving the value of this property is an O(1) operation.
## Examples
The following code example creates a read-only collection.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase.IsReadOnly#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.IsReadOnly/CPP/nocb_isreadonly.cpp#1)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase.IsReadOnly#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.IsReadOnly/CS/nocb_isreadonly.cs#1)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase.IsReadOnly#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.IsReadOnly/VB/nocb_isreadonly.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Keys">
<MemberSignature Language="C#" Value="public virtual System.Collections.Specialized.NameObjectCollectionBase.KeysCollection Keys { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Specialized.NameObjectCollectionBase/KeysCollection Keys" />
<MemberSignature Language="DocId" Value="P:System.Collections.Specialized.NameObjectCollectionBase.Keys" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property Keys As NameObjectCollectionBase.KeysCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Collections::Specialized::NameObjectCollectionBase::KeysCollection ^ Keys { System::Collections::Specialized::NameObjectCollectionBase::KeysCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Keys : System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" Usage="System.Collections.Specialized.NameObjectCollectionBase.Keys" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Collections.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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.Specialized.NameObjectCollectionBase+KeysCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" /> instance that contains all the keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</summary>
<value>A <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" /> instance that contains all the keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Retrieving the value of this property is an O(1) operation.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="OnDeserialization">
<MemberSignature Language="C#" Value="public virtual void OnDeserialization (object sender);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void OnDeserialization(object sender) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Collections.Specialized.NameObjectCollectionBase.OnDeserialization(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub OnDeserialization (sender As Object)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void OnDeserialization(System::Object ^ sender);" />
<MemberSignature Language="F#" Value="abstract member OnDeserialization : obj -&gt; unit&#xA;override this.OnDeserialization : obj -&gt; unit" Usage="nameObjectCollectionBase.OnDeserialization sender" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(System.Object)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System</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.Specialized</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="sender" Type="System.Object" 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" />
</Parameters>
<Docs>
<param name="sender">The source of the deserialization event.</param>
<summary>Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and raises the deserialization event when the deserialization is complete.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
While the <xref:System.Collections.Specialized.NameObjectCollectionBase.OnDeserialization%2A> method is not visible to COM clients by default, inheriting the <xref:System.Collections.Specialized.NameObjectCollectionBase> class can expose it and can cause undesirable behavior in COM clients.
This method is an O(`n`) operation, where `n` is <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A>.
]]></format>
</remarks>
<exception cref="T:System.Runtime.Serialization.SerializationException">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object associated with the current <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance is invalid.</exception>
<altmember cref="T:System.Runtime.Serialization.ISerializable" />
<altmember cref="M:System.Collections.Specialized.NameObjectCollectionBase.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
</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.Specialized.NameObjectCollectionBase.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.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</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="array" Type="System.Array" />
<Parameter Name="index" Type="System.Int32" />
</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.Specialized.NameObjectCollectionBase" />. 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.Specialized.NameObjectCollectionBase" /> 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.
This method uses <xref:System.Array.Copy%2A?displayProperty=nameWithType> to copy the elements.
While the <xref:System.Collections.Specialized.NameObjectCollectionBase.System%23Collections%23ICollection%23CopyTo%2A> method is not visible to COM clients by default, inheriting the <xref:System.Collections.Specialized.NameObjectCollectionBase> class can expose it and can cause undesirable behavior in COM clients.
This method is an O(`n`) operation, where `n` is <xref:System.Collections.Specialized.NameObjectCollectionBase.Count%2A>.
]]></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.Specialized.NameObjectCollectionBase" /> 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.Specialized.NameObjectCollectionBase" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
</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.Specialized.NameObjectCollectionBase.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.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<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>
<Docs>
<summary>Gets a value indicating whether access to the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> object is synchronized (thread safe).</summary>
<value>
<see langword="true" /> if access to the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> object is synchronized (thread safe); otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A <xref:System.Collections.Specialized.NameObjectCollectionBase> object is not synchronized. Derived classes can provide a synchronized version of the <xref:System.Collections.Specialized.NameObjectCollectionBase> using the <xref:System.Collections.ICollection.SyncRoot%2A> property.
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.
The following code example shows how to lock the collection using the <xref:System.Collections.ICollection.SyncRoot%2A> property during the entire enumeration.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase#2](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CPP/remarks.cpp#2)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/remarks.cs#2)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/VB/remarks.vb#2)]
Retrieving the value of this property is an O(1) operation.
]]></format>
</remarks>
<altmember cref="P:System.Collections.ICollection.SyncRoot" />
</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.Specialized.NameObjectCollectionBase.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.Specialized</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<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.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> object.</summary>
<value>An object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> object.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Derived classes can provide their own synchronized version of the <xref:System.Collections.Specialized.NameObjectCollectionBase> class using the <xref:System.Collections.ICollection.SyncRoot%2A> property. The synchronizing code must perform operations on the <xref:System.Collections.ICollection.SyncRoot%2A> property of the <xref:System.Collections.Specialized.NameObjectCollectionBase> object, not directly on the <xref:System.Collections.Specialized.NameObjectCollectionBase> object. 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.Specialized.NameObjectCollectionBase> 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.
The following code example shows how to lock the collection using the <xref:System.Collections.ICollection.SyncRoot%2A> during the entire enumeration.
[!code-cpp[System.Collections.Specialized.NameObjectCollectionBase#2](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CPP/remarks.cpp#2)]
[!code-csharp[System.Collections.Specialized.NameObjectCollectionBase#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/remarks.cs#2)]
[!code-vb[System.Collections.Specialized.NameObjectCollectionBase#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/VB/remarks.vb#2)]
Retrieving the value of this property is an O(1) operation.
]]></format>
</remarks>
<altmember cref="P:System.Collections.ICollection.IsSynchronized" />
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.