NameObjectCollectionBase NameObjectCollectionBase NameObjectCollectionBase NameObjectCollectionBase Constructors

Definition

Overloads

NameObjectCollectionBase() NameObjectCollectionBase() NameObjectCollectionBase()

Initializes a new instance of the NameObjectCollectionBase class that is empty.

NameObjectCollectionBase(IEqualityComparer) NameObjectCollectionBase(IEqualityComparer) NameObjectCollectionBase(IEqualityComparer) NameObjectCollectionBase(IEqualityComparer)

Initializes a new instance of the NameObjectCollectionBase class that is empty, has the default initial capacity, and uses the specified IEqualityComparer object.

NameObjectCollectionBase(Int32) NameObjectCollectionBase(Int32) NameObjectCollectionBase(Int32) NameObjectCollectionBase(Int32)

Initializes a new instance of the NameObjectCollectionBase class that is empty, has the specified initial capacity, and uses the default hash code provider and the default comparer.

NameObjectCollectionBase(IHashCodeProvider, IComparer) NameObjectCollectionBase(IHashCodeProvider, IComparer) NameObjectCollectionBase(IHashCodeProvider, IComparer) NameObjectCollectionBase(IHashCodeProvider, IComparer)

Initializes a new instance of the NameObjectCollectionBase class that is empty, has the default initial capacity, and uses the specified hash code provider and the specified comparer.

NameObjectCollectionBase(Int32, IEqualityComparer) NameObjectCollectionBase(Int32, IEqualityComparer) NameObjectCollectionBase(Int32, IEqualityComparer) NameObjectCollectionBase(Int32, IEqualityComparer)

Initializes a new instance of the NameObjectCollectionBase class that is empty, has the specified initial capacity, and uses the specified IEqualityComparer object.

NameObjectCollectionBase(SerializationInfo, StreamingContext) NameObjectCollectionBase(SerializationInfo, StreamingContext) NameObjectCollectionBase(SerializationInfo, StreamingContext) NameObjectCollectionBase(SerializationInfo, StreamingContext)

Initializes a new instance of the NameObjectCollectionBase class that is serializable and uses the specified SerializationInfo and StreamingContext.

NameObjectCollectionBase(Int32, IHashCodeProvider, IComparer) NameObjectCollectionBase(Int32, IHashCodeProvider, IComparer) NameObjectCollectionBase(Int32, IHashCodeProvider, IComparer) NameObjectCollectionBase(Int32, IHashCodeProvider, IComparer)

Initializes a new instance of the NameObjectCollectionBase class that is empty, has the specified initial capacity and uses the specified hash code provider and the specified comparer.

NameObjectCollectionBase() NameObjectCollectionBase() NameObjectCollectionBase()

Initializes a new instance of the NameObjectCollectionBase class that is empty.

protected:
 NameObjectCollectionBase();
protected NameObjectCollectionBase ();
Protected Sub New ()

Remarks

The capacity of a NameObjectCollectionBase is the number of elements that the NameObjectCollectionBase can hold. As elements are added to a 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 NameObjectCollectionBase.

The hash code provider dispenses hash codes for keys in the NameObjectCollectionBase instance. The default hash code provider is the CaseInsensitiveHashCodeProvider.

The comparer determines whether two keys are equal. The default comparer is the CaseInsensitiveComparer.

This constructor is an O(1) operation.

See also

NameObjectCollectionBase(IEqualityComparer) NameObjectCollectionBase(IEqualityComparer) NameObjectCollectionBase(IEqualityComparer) NameObjectCollectionBase(IEqualityComparer)

Initializes a new instance of the NameObjectCollectionBase class that is empty, has the default initial capacity, and uses the specified IEqualityComparer object.

protected:
 NameObjectCollectionBase(System::Collections::IEqualityComparer ^ equalityComparer);
protected NameObjectCollectionBase (System.Collections.IEqualityComparer equalityComparer);
new System.Collections.Specialized.NameObjectCollectionBase : System.Collections.IEqualityComparer -> System.Collections.Specialized.NameObjectCollectionBase
Protected Sub New (equalityComparer As IEqualityComparer)

Parameters

equalityComparer
IEqualityComparer IEqualityComparer IEqualityComparer IEqualityComparer

The IEqualityComparer object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection.

Remarks

The capacity of a NameObjectCollectionBase object is the number of elements that the NameObjectCollectionBase can hold. As elements are added to a 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 NameObjectCollectionBase.

The IEqualityComparer object combines the comparer and the hash code provider. The hash code provider dispenses hash codes for keys in the NameObjectCollectionBase. The comparer determines whether two keys are equal.

This constructor is an O(1) operation.

See also

NameObjectCollectionBase(Int32) NameObjectCollectionBase(Int32) NameObjectCollectionBase(Int32) NameObjectCollectionBase(Int32)

Initializes a new instance of the NameObjectCollectionBase class that is empty, has the specified initial capacity, and uses the default hash code provider and the default comparer.

protected:
 NameObjectCollectionBase(int capacity);
protected NameObjectCollectionBase (int capacity);
new System.Collections.Specialized.NameObjectCollectionBase : int -> System.Collections.Specialized.NameObjectCollectionBase
Protected Sub New (capacity As Integer)

Parameters

capacity
Int32 Int32 Int32 Int32

The approximate number of entries that the NameObjectCollectionBase instance can initially contain.

Exceptions

Remarks

The capacity of a NameObjectCollectionBase is the number of elements that the NameObjectCollectionBase can hold. As elements are added to a 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 NameObjectCollectionBase.

The hash code provider dispenses hash codes for keys in the NameObjectCollectionBase instance. The default hash code provider is the CaseInsensitiveHashCodeProvider.

The comparer determines whether two keys are equal. The default comparer is the CaseInsensitiveComparer.

This constructor is an O(n) operation, where n is capacity.

See also

NameObjectCollectionBase(IHashCodeProvider, IComparer) NameObjectCollectionBase(IHashCodeProvider, IComparer) NameObjectCollectionBase(IHashCodeProvider, IComparer) NameObjectCollectionBase(IHashCodeProvider, IComparer)

Warning

This API is now obsolete.

Initializes a new instance of the NameObjectCollectionBase class that is empty, has the default initial capacity, and uses the specified hash code provider and the specified comparer.

protected:
 NameObjectCollectionBase(System::Collections::IHashCodeProvider ^ hashProvider, System::Collections::IComparer ^ comparer);
[System.Obsolete("Please use NameObjectCollectionBase(IEqualityComparer) instead.")]
protected NameObjectCollectionBase (System.Collections.IHashCodeProvider hashProvider, System.Collections.IComparer comparer);
new System.Collections.Specialized.NameObjectCollectionBase : System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameObjectCollectionBase
Protected Sub New (hashProvider As IHashCodeProvider, comparer As IComparer)

Parameters

hashProvider
IHashCodeProvider IHashCodeProvider IHashCodeProvider IHashCodeProvider

The IHashCodeProvider that will supply the hash codes for all keys in the NameObjectCollectionBase instance.

comparer
IComparer IComparer IComparer IComparer

The IComparer to use to determine whether two keys are equal.

Remarks

The capacity of a NameObjectCollectionBase is the number of elements that the NameObjectCollectionBase can hold. As elements are added to a 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 NameObjectCollectionBase.

The hash code provider dispenses hash codes for keys in the NameObjectCollectionBase instance. The default hash code provider is the CaseInsensitiveHashCodeProvider.

The comparer determines whether two keys are equal. The default comparer is the CaseInsensitiveComparer.

This constructor is an O(1) operation.

See also

NameObjectCollectionBase(Int32, IEqualityComparer) NameObjectCollectionBase(Int32, IEqualityComparer) NameObjectCollectionBase(Int32, IEqualityComparer) NameObjectCollectionBase(Int32, IEqualityComparer)

Initializes a new instance of the NameObjectCollectionBase class that is empty, has the specified initial capacity, and uses the specified IEqualityComparer object.

protected:
 NameObjectCollectionBase(int capacity, System::Collections::IEqualityComparer ^ equalityComparer);
protected NameObjectCollectionBase (int capacity, System.Collections.IEqualityComparer equalityComparer);
new System.Collections.Specialized.NameObjectCollectionBase : int * System.Collections.IEqualityComparer -> System.Collections.Specialized.NameObjectCollectionBase
Protected Sub New (capacity As Integer, equalityComparer As IEqualityComparer)

Parameters

capacity
Int32 Int32 Int32 Int32

The approximate number of entries that the NameObjectCollectionBase object can initially contain.

equalityComparer
IEqualityComparer IEqualityComparer IEqualityComparer IEqualityComparer

The IEqualityComparer object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection.

Exceptions

Remarks

The capacity of a NameObjectCollectionBase object is the number of elements that the NameObjectCollectionBase can hold. As elements are added to a 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 NameObjectCollectionBase.

The IEqualityComparer object combines the comparer and the hash code provider. The hash code provider dispenses hash codes for keys in the NameObjectCollectionBase. The comparer determines whether two keys are equal.

This constructor is an O(n) operation, where n is the capacity parameter.

See also

NameObjectCollectionBase(SerializationInfo, StreamingContext) NameObjectCollectionBase(SerializationInfo, StreamingContext) NameObjectCollectionBase(SerializationInfo, StreamingContext) NameObjectCollectionBase(SerializationInfo, StreamingContext)

Initializes a new instance of the NameObjectCollectionBase class that is serializable and uses the specified SerializationInfo and StreamingContext.

protected:
 NameObjectCollectionBase(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected NameObjectCollectionBase (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Collections.Specialized.NameObjectCollectionBase : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Collections.Specialized.NameObjectCollectionBase
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parameters

info
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

A SerializationInfo object that contains the information required to serialize the new NameObjectCollectionBase instance.

context
StreamingContext StreamingContext StreamingContext StreamingContext

A StreamingContext object that contains the source and destination of the serialized stream associated with the new NameObjectCollectionBase instance.

Remarks

This constructor is an O(1) operation.

See also

NameObjectCollectionBase(Int32, IHashCodeProvider, IComparer) NameObjectCollectionBase(Int32, IHashCodeProvider, IComparer) NameObjectCollectionBase(Int32, IHashCodeProvider, IComparer) NameObjectCollectionBase(Int32, IHashCodeProvider, IComparer)

Warning

This API is now obsolete.

Initializes a new instance of the NameObjectCollectionBase class that is empty, has the specified initial capacity and uses the specified hash code provider and the specified comparer.

protected:
 NameObjectCollectionBase(int capacity, System::Collections::IHashCodeProvider ^ hashProvider, System::Collections::IComparer ^ comparer);
[System.Obsolete("Please use NameObjectCollectionBase(Int32, IEqualityComparer) instead.")]
protected NameObjectCollectionBase (int capacity, System.Collections.IHashCodeProvider hashProvider, System.Collections.IComparer comparer);
new System.Collections.Specialized.NameObjectCollectionBase : int * System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameObjectCollectionBase
Protected Sub New (capacity As Integer, hashProvider As IHashCodeProvider, comparer As IComparer)

Parameters

capacity
Int32 Int32 Int32 Int32

The approximate number of entries that the NameObjectCollectionBase instance can initially contain.

hashProvider
IHashCodeProvider IHashCodeProvider IHashCodeProvider IHashCodeProvider

The IHashCodeProvider that will supply the hash codes for all keys in the NameObjectCollectionBase instance.

comparer
IComparer IComparer IComparer IComparer

The IComparer to use to determine whether two keys are equal.

Exceptions

Remarks

The capacity of a NameObjectCollectionBase is the number of elements that the NameObjectCollectionBase can hold. As elements are added to a 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 NameObjectCollectionBase.

The hash code provider dispenses hash codes for keys in the NameObjectCollectionBase instance. The default hash code provider is the CaseInsensitiveHashCodeProvider.

The comparer determines whether two keys are equal. The default comparer is the CaseInsensitiveComparer.

This constructor is an O(n) operation, where n is capacity.

See also

Applies to