CollectionsUtil.CreateCaseInsensitiveHashtable 方法

定义

创建 Hashtable 类的新实例,该实例忽略字符串的大小写。Creates a new instance of the Hashtable class that ignores the case of strings.

重载

CreateCaseInsensitiveHashtable()

创建 Hashtable 类具有默认初始容量的不区分大小写的新实例。Creates a new case-insensitive instance of the Hashtable class with the default initial capacity.

CreateCaseInsensitiveHashtable(IDictionary)

将项从指定字典复制到 Hashtable 类的不区分大小写的新实例,该实例具有与复制项的数量相同的初始容量。Copies the entries from the specified dictionary to a new case-insensitive instance of the Hashtable class with the same initial capacity as the number of entries copied.

CreateCaseInsensitiveHashtable(Int32)

创建 Hashtable 类具有指定初始容量的不区分大小写的新实例。Creates a new case-insensitive instance of the Hashtable class with the specified initial capacity.

CreateCaseInsensitiveHashtable()

创建 Hashtable 类具有默认初始容量的不区分大小写的新实例。Creates a new case-insensitive instance of the Hashtable class with the default initial capacity.

public:
 static System::Collections::Hashtable ^ CreateCaseInsensitiveHashtable();
public static System.Collections.Hashtable CreateCaseInsensitiveHashtable ();
static member CreateCaseInsensitiveHashtable : unit -> System.Collections.Hashtable
Public Shared Function CreateCaseInsensitiveHashtable () As Hashtable

返回

Hashtable

Hashtable 类具有默认初始容量的不区分大小写的新实例。A new case-insensitive instance of the Hashtable class with the default initial capacity.

注解

CreateCaseInsensitiveHashtable使用 Hashtable.Hashtable(IEqualityComparer) 构造函数来创建不区分大小写的类,而不是使用方法 HashtableInstead of using the CreateCaseInsensitiveHashtable method, use the Hashtable.Hashtable(IEqualityComparer) constructor to create a case-insensitive Hashtable class.

另请参阅

CreateCaseInsensitiveHashtable(IDictionary)

将项从指定字典复制到 Hashtable 类的不区分大小写的新实例,该实例具有与复制项的数量相同的初始容量。Copies the entries from the specified dictionary to a new case-insensitive instance of the Hashtable class with the same initial capacity as the number of entries copied.

public:
 static System::Collections::Hashtable ^ CreateCaseInsensitiveHashtable(System::Collections::IDictionary ^ d);
public static System.Collections.Hashtable CreateCaseInsensitiveHashtable (System.Collections.IDictionary d);
static member CreateCaseInsensitiveHashtable : System.Collections.IDictionary -> System.Collections.Hashtable
Public Shared Function CreateCaseInsensitiveHashtable (d As IDictionary) As Hashtable

参数

d
IDictionary

要复制到不区分大小写的新 IDictionaryHashtableThe IDictionary to copy to a new case-insensitive Hashtable.

返回

Hashtable

Hashtable 类的不区分大小写的新实例,该实例包含指定的 IDictionary 中的项。A new case-insensitive instance of the Hashtable class containing the entries from the specified IDictionary.

例外

dnulld is null.

注解

CreateCaseInsensitiveHashtable使用 Hashtable.Hashtable(IDictionary, IEqualityComparer) 构造函数来创建不区分大小写的类,而不是使用方法 HashtableInstead of using the CreateCaseInsensitiveHashtable method, use the Hashtable.Hashtable(IDictionary, IEqualityComparer) constructor to create a case-insensitive Hashtable class.

另请参阅

CreateCaseInsensitiveHashtable(Int32)

创建 Hashtable 类具有指定初始容量的不区分大小写的新实例。Creates a new case-insensitive instance of the Hashtable class with the specified initial capacity.

public:
 static System::Collections::Hashtable ^ CreateCaseInsensitiveHashtable(int capacity);
public static System.Collections.Hashtable CreateCaseInsensitiveHashtable (int capacity);
static member CreateCaseInsensitiveHashtable : int -> System.Collections.Hashtable
Public Shared Function CreateCaseInsensitiveHashtable (capacity As Integer) As Hashtable

参数

capacity
Int32

Hashtable 最初可包含的大概项数。The approximate number of entries that the Hashtable can initially contain.

返回

Hashtable

具有指定初始容量的 Hashtable 类的不区分大小写的新实例。A new case-insensitive instance of the Hashtable class with the specified initial capacity.

例外

capacity 小于零。capacity is less than zero.

注解

CreateCaseInsensitiveHashtable使用 Hashtable.Hashtable(Int32, IEqualityComparer) 构造函数来创建不区分大小写的类,而不是使用方法 HashtableInstead of using the CreateCaseInsensitiveHashtable method, use the Hashtable.Hashtable(Int32, IEqualityComparer) constructor to create a case-insensitive Hashtable class.

另请参阅

适用于