NameObjectCollectionBase 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 NameObjectCollectionBase 类的新实例。
重载
| 名称 | 说明 |
|---|---|
| NameObjectCollectionBase() |
初始化为空的 NameObjectCollectionBase 类的新实例。 |
| NameObjectCollectionBase(IEqualityComparer) |
初始化为空的 NameObjectCollectionBase 类的新实例,具有默认的初始容量,并使用指定的 IEqualityComparer 对象。 |
| NameObjectCollectionBase(Int32) |
初始化为空的 NameObjectCollectionBase 类的新实例,具有指定的初始容量,并使用默认哈希代码提供程序和默认比较器。 |
| NameObjectCollectionBase(IHashCodeProvider, IComparer) |
已过时.
已过时.
初始化为空的 NameObjectCollectionBase 类的新实例,具有默认的初始容量,并使用指定的哈希代码提供程序和指定的比较器。 |
| NameObjectCollectionBase(Int32, IEqualityComparer) |
初始化为空的 NameObjectCollectionBase 类的新实例,具有指定的初始容量,并使用指定的 IEqualityComparer 对象。 |
| NameObjectCollectionBase(SerializationInfo, StreamingContext) |
已过时.
初始化可序列化的 NameObjectCollectionBase 类的新实例,并使用指定的 SerializationInfo 和 StreamingContext。 |
| NameObjectCollectionBase(Int32, IHashCodeProvider, IComparer) |
已过时.
已过时.
初始化为空的 NameObjectCollectionBase 类的新实例,具有指定的初始容量,并使用指定的哈希代码提供程序和指定的比较器。 |
NameObjectCollectionBase()
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
初始化为空的 NameObjectCollectionBase 类的新实例。
protected:
NameObjectCollectionBase();
protected NameObjectCollectionBase();
Protected Sub New ()
注解
一个 NameObjectCollectionBase 元素的容量是可以容纳的元素 NameObjectCollectionBase 数。 随着元素添加到 a NameObjectCollectionBase,重新分配内部数组,容量会自动增加。
如果可以估计集合的大小,则指定初始容量无需在向集合中添加元素 NameObjectCollectionBase时执行大量调整大小操作。
哈希代码提供程序为实例中的 NameObjectCollectionBase 密钥分配哈希代码。 默认哈希代码提供程序为 CaseInsensitiveHashCodeProvider.
比较器确定两个键是否相等。 默认比较器为 CaseInsensitiveComparer.
此构造函数是 O(1) 操作。
另请参阅
适用于
NameObjectCollectionBase(IEqualityComparer)
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
初始化为空的 NameObjectCollectionBase 类的新实例,具有默认的初始容量,并使用指定的 IEqualityComparer 对象。
protected:
NameObjectCollectionBase(System::Collections::IEqualityComparer ^ equalityComparer);
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)
参数
- equalityComparer
- IEqualityComparer
IEqualityComparer用于确定两个键是否相等以及为集合中的键生成哈希代码的对象。
注解
对象的容量 NameObjectCollectionBase 是可以容纳的元素 NameObjectCollectionBase 数。 随着元素添加到 a NameObjectCollectionBase,重新分配内部数组,容量会自动增加。
如果可以估计集合的大小,则指定初始容量无需在向集合中添加元素 NameObjectCollectionBase时执行大量调整大小操作。
该 IEqualityComparer 对象合并了比较器和哈希代码提供程序。 哈希代码提供程序为键 NameObjectCollectionBase分配哈希代码。 比较器确定两个键是否相等。
此构造函数是 O(1) 操作。
另请参阅
适用于
NameObjectCollectionBase(Int32)
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
初始化为空的 NameObjectCollectionBase 类的新实例,具有指定的初始容量,并使用默认哈希代码提供程序和默认比较器。
protected:
NameObjectCollectionBase(int capacity);
protected NameObjectCollectionBase(int capacity);
new System.Collections.Specialized.NameObjectCollectionBase : int -> System.Collections.Specialized.NameObjectCollectionBase
Protected Sub New (capacity As Integer)
参数
- capacity
- Int32
实例最初可以包含的大致条目 NameObjectCollectionBase 数。
例外
capacity 小于零。
注解
一个 NameObjectCollectionBase 元素的容量是可以容纳的元素 NameObjectCollectionBase 数。 随着元素添加到 a NameObjectCollectionBase,重新分配内部数组,容量会自动增加。
如果可以估计集合的大小,则指定初始容量无需在向集合中添加元素 NameObjectCollectionBase时执行大量调整大小操作。
哈希代码提供程序为实例中的 NameObjectCollectionBase 密钥分配哈希代码。 默认哈希代码提供程序为 CaseInsensitiveHashCodeProvider.
比较器确定两个键是否相等。 默认比较器为 CaseInsensitiveComparer.
此构造函数是 O(n) 操作,其中 n 。capacity
另请参阅
适用于
NameObjectCollectionBase(IHashCodeProvider, IComparer)
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
注意
This constructor has been deprecated. Use NameObjectCollectionBase(IEqualityComparer) instead.
注意
Please use NameObjectCollectionBase(IEqualityComparer) instead.
初始化为空的 NameObjectCollectionBase 类的新实例,具有默认的初始容量,并使用指定的哈希代码提供程序和指定的比较器。
protected:
NameObjectCollectionBase(System::Collections::IHashCodeProvider ^ hashProvider, System::Collections::IComparer ^ comparer);
[System.Obsolete("This constructor has been deprecated. Use NameObjectCollectionBase(IEqualityComparer) instead.")]
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);
[System.Obsolete("Please use NameObjectCollectionBase(IEqualityComparer) instead.")]
protected NameObjectCollectionBase(System.Collections.IHashCodeProvider hashProvider, System.Collections.IComparer comparer);
protected NameObjectCollectionBase(System.Collections.IHashCodeProvider hashProvider, System.Collections.IComparer comparer);
[<System.Obsolete("This constructor has been deprecated. Use NameObjectCollectionBase(IEqualityComparer) instead.")>]
new System.Collections.Specialized.NameObjectCollectionBase : System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameObjectCollectionBase
[<System.Obsolete("Please use NameObjectCollectionBase(IEqualityComparer) instead.")>]
new System.Collections.Specialized.NameObjectCollectionBase : System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameObjectCollectionBase
new System.Collections.Specialized.NameObjectCollectionBase : System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameObjectCollectionBase
Protected Sub New (hashProvider As IHashCodeProvider, comparer As IComparer)
参数
- hashProvider
- IHashCodeProvider
这将 IHashCodeProvider 为实例中的所有 NameObjectCollectionBase 键提供哈希代码。
- 特性
注解
一个 NameObjectCollectionBase 元素的容量是可以容纳的元素 NameObjectCollectionBase 数。 随着元素添加到 a NameObjectCollectionBase,重新分配内部数组,容量会自动增加。
如果可以估计集合的大小,则指定初始容量无需在向集合中添加元素 NameObjectCollectionBase时执行大量调整大小操作。
哈希代码提供程序为实例中的 NameObjectCollectionBase 密钥分配哈希代码。 默认哈希代码提供程序为 CaseInsensitiveHashCodeProvider.
比较器确定两个键是否相等。 默认比较器为 CaseInsensitiveComparer.
此构造函数是 O(1) 操作。
另请参阅
- IHashCodeProvider
- IComparer
- CaseInsensitiveHashCodeProvider
- CaseInsensitiveComparer
- 执行 Culture-Insensitive 字符串操作
适用于
NameObjectCollectionBase(Int32, IEqualityComparer)
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
初始化为空的 NameObjectCollectionBase 类的新实例,具有指定的初始容量,并使用指定的 IEqualityComparer 对象。
protected:
NameObjectCollectionBase(int capacity, System::Collections::IEqualityComparer ^ equalityComparer);
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)
参数
- capacity
- Int32
对象最初可以包含的大致条目 NameObjectCollectionBase 数。
- equalityComparer
- IEqualityComparer
IEqualityComparer用于确定两个键是否相等以及为集合中的键生成哈希代码的对象。
例外
capacity 小于零。
注解
对象的容量 NameObjectCollectionBase 是可以容纳的元素 NameObjectCollectionBase 数。 随着元素添加到 a NameObjectCollectionBase,重新分配内部数组,容量会自动增加。
如果可以估计集合的大小,则指定初始容量无需在向集合中添加元素 NameObjectCollectionBase时执行大量调整大小操作。
该 IEqualityComparer 对象合并了比较器和哈希代码提供程序。 哈希代码提供程序为键 NameObjectCollectionBase分配哈希代码。 比较器确定两个键是否相等。
此构造函数是一个 O(n) 操作,其中 n 是 capacity 参数。
另请参阅
适用于
NameObjectCollectionBase(SerializationInfo, StreamingContext)
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
注意
This API supports obsolete formatter-based serialization. It should not be called or extended by application code.
初始化可序列化的 NameObjectCollectionBase 类的新实例,并使用指定的 SerializationInfo 和 StreamingContext。
protected:
NameObjectCollectionBase(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected NameObjectCollectionBase(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected NameObjectCollectionBase(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Collections.Specialized.NameObjectCollectionBase : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Collections.Specialized.NameObjectCollectionBase
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)
参数
- info
- SerializationInfo
包含 SerializationInfo 序列化新 NameObjectCollectionBase 实例所需的信息的对象。
- context
- StreamingContext
一个 StreamingContext 对象,该对象包含与新 NameObjectCollectionBase 实例关联的序列化流的源和目标。
- 特性
注解
此构造函数是 O(1) 操作。
另请参阅
适用于
NameObjectCollectionBase(Int32, IHashCodeProvider, IComparer)
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
- Source:
- NameObjectCollectionBase.cs
注意
This constructor has been deprecated. Use NameObjectCollectionBase(Int32, IEqualityComparer) instead.
注意
Please use NameObjectCollectionBase(Int32, IEqualityComparer) instead.
初始化为空的 NameObjectCollectionBase 类的新实例,具有指定的初始容量,并使用指定的哈希代码提供程序和指定的比较器。
protected:
NameObjectCollectionBase(int capacity, System::Collections::IHashCodeProvider ^ hashProvider, System::Collections::IComparer ^ comparer);
[System.Obsolete("This constructor has been deprecated. Use NameObjectCollectionBase(Int32, IEqualityComparer) instead.")]
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);
[System.Obsolete("Please use NameObjectCollectionBase(Int32, IEqualityComparer) instead.")]
protected NameObjectCollectionBase(int capacity, System.Collections.IHashCodeProvider hashProvider, System.Collections.IComparer comparer);
protected NameObjectCollectionBase(int capacity, System.Collections.IHashCodeProvider hashProvider, System.Collections.IComparer comparer);
[<System.Obsolete("This constructor has been deprecated. Use NameObjectCollectionBase(Int32, IEqualityComparer) instead.")>]
new System.Collections.Specialized.NameObjectCollectionBase : int * System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameObjectCollectionBase
[<System.Obsolete("Please use NameObjectCollectionBase(Int32, IEqualityComparer) instead.")>]
new System.Collections.Specialized.NameObjectCollectionBase : int * System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameObjectCollectionBase
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)
参数
- capacity
- Int32
实例最初可以包含的大致条目 NameObjectCollectionBase 数。
- hashProvider
- IHashCodeProvider
这将 IHashCodeProvider 为实例中的所有 NameObjectCollectionBase 键提供哈希代码。
- 特性
例外
capacity 小于零。
注解
一个 NameObjectCollectionBase 元素的容量是可以容纳的元素 NameObjectCollectionBase 数。 随着元素添加到 a NameObjectCollectionBase,重新分配内部数组,容量会自动增加。
如果可以估计集合的大小,则指定初始容量无需在向集合中添加元素 NameObjectCollectionBase时执行大量调整大小操作。
哈希代码提供程序为实例中的 NameObjectCollectionBase 密钥分配哈希代码。 默认哈希代码提供程序为 CaseInsensitiveHashCodeProvider.
比较器确定两个键是否相等。 默认比较器为 CaseInsensitiveComparer.
此构造函数是 O(n) 操作,其中 n 。capacity
另请参阅
- IHashCodeProvider
- CaseInsensitiveHashCodeProvider
- IComparer
- CaseInsensitiveComparer
- 执行 Culture-Insensitive 字符串操作