NameValueCollection コンストラクター

定義

NameValueCollection クラスの新しいインスタンスを初期化します。

オーバーロード

名前 説明
NameValueCollection()

空の NameValueCollection クラスの新しいインスタンスを初期化し、既定の初期容量を持ち、既定の大文字と小文字を区別しないハッシュ コード プロバイダーと既定の大文字と小文字を区別しない比較子を使用します。

NameValueCollection(IEqualityComparer)

空の NameValueCollection クラスの新しいインスタンスを初期化し、既定の初期容量を持ち、指定した IEqualityComparer オブジェクトを使用します。

NameValueCollection(NameValueCollection)

コピーされたエントリの数と同じ初期容量を持ち、ソース コレクションと同じハッシュ コード プロバイダーと同じ比較子を使用して、指定した NameValueCollection から新しい NameValueCollection にエントリをコピーします。

NameValueCollection(Int32)

空の NameValueCollection クラスの新しいインスタンスを初期化し、指定された初期容量を持ち、既定の大文字と小文字を区別しないハッシュ コード プロバイダーと既定の大文字と小文字を区別しない比較子を使用します。

NameValueCollection(IHashCodeProvider, IComparer)
古い.
古い.

空の NameValueCollection クラスの新しいインスタンスを初期化し、既定の初期容量を持ち、指定したハッシュ コード プロバイダーと指定された比較子を使用します。

NameValueCollection(Int32, IEqualityComparer)

空の NameValueCollection クラスの新しいインスタンスを初期化し、指定した初期容量を持ち、指定した IEqualityComparer オブジェクトを使用します。

NameValueCollection(Int32, NameValueCollection)

指定した NameValueCollection のエントリを新しい NameValueCollection にコピーします。初期容量は、コピーされたエントリの数のいずれか大きい方と同じで、既定の大文字と小文字を区別しないハッシュ コード プロバイダーと既定の大文字と小文字を区別しない比較子を使用します。

NameValueCollection(SerializationInfo, StreamingContext)
古い.

シリアル化可能で、指定したNameValueCollectionSerializationInfoを使用するStreamingContext クラスの新しいインスタンスを初期化します。

NameValueCollection(Int32, IHashCodeProvider, IComparer)
古い.
古い.

空の NameValueCollection クラスの新しいインスタンスを初期化し、指定した初期容量を持ち、指定したハッシュ コード プロバイダーと指定された比較子を使用します。

NameValueCollection()

ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs

空の NameValueCollection クラスの新しいインスタンスを初期化し、既定の初期容量を持ち、既定の大文字と小文字を区別しないハッシュ コード プロバイダーと既定の大文字と小文字を区別しない比較子を使用します。

public:
 NameValueCollection();
public NameValueCollection();
Public Sub New ()

注釈

NameValueCollectionの容量は、NameValueCollectionが保持できる要素の数です。 要素が NameValueCollectionに追加されると、内部配列を再割り当てすることで、必要に応じて容量が自動的に増加します。

コレクションのサイズを見積もることができる場合、初期容量を指定すると、 NameValueCollectionに要素を追加するときに、多数のサイズ変更操作を実行する必要がなくなります。

ハッシュ コード プロバイダーは、 NameValueCollection内のキーのハッシュ コードを分配します。 既定のハッシュ コード プロバイダーは CaseInsensitiveHashCodeProviderです。

比較子は、2 つのキーが等しいかどうかを判断します。 既定の比較子は CaseInsensitiveComparerです。

このコンストラクターは O(1) 操作です。

こちらもご覧ください

適用対象

NameValueCollection(IEqualityComparer)

ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs

空の NameValueCollection クラスの新しいインスタンスを初期化し、既定の初期容量を持ち、指定した IEqualityComparer オブジェクトを使用します。

public:
 NameValueCollection(System::Collections::IEqualityComparer ^ equalityComparer);
public NameValueCollection(System.Collections.IEqualityComparer equalityComparer);
public NameValueCollection(System.Collections.IEqualityComparer? equalityComparer);
new System.Collections.Specialized.NameValueCollection : System.Collections.IEqualityComparer -> System.Collections.Specialized.NameValueCollection
Public Sub New (equalityComparer As IEqualityComparer)

パラメーター

equalityComparer
IEqualityComparer

2 つのキーが等しいかどうかを判断し、コレクション内のキーのハッシュ コードを生成するために使用する IEqualityComparer オブジェクト。

注釈

NameValueCollection オブジェクトの容量は、NameValueCollectionが保持できる要素の数です。 要素が NameValueCollectionに追加されると、内部配列を再割り当てすることで、必要に応じて容量が自動的に増加します。

コレクションのサイズを見積もることができる場合、初期容量を指定すると、 NameValueCollectionに要素を追加するときに、多数のサイズ変更操作を実行する必要がなくなります。

IEqualityComparer オブジェクトは、比較子とハッシュ コード プロバイダーを結合します。 ハッシュ コード プロバイダーは、 NameValueCollection内のキーのハッシュ コードを分配します。 比較子は、2 つのキーが等しいかどうかを判断します。

このコンストラクターは O(1) 操作です。

こちらもご覧ください

適用対象

NameValueCollection(NameValueCollection)

ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs

コピーされたエントリの数と同じ初期容量を持ち、ソース コレクションと同じハッシュ コード プロバイダーと同じ比較子を使用して、指定した NameValueCollection から新しい NameValueCollection にエントリをコピーします。

public:
 NameValueCollection(System::Collections::Specialized::NameValueCollection ^ col);
public NameValueCollection(System.Collections.Specialized.NameValueCollection col);
new System.Collections.Specialized.NameValueCollection : System.Collections.Specialized.NameValueCollection -> System.Collections.Specialized.NameValueCollection
Public Sub New (col As NameValueCollection)

パラメーター

col
NameValueCollection

新しいNameValueCollection インスタンスにコピーするNameValueCollection

例外

colnullです。

注釈

NameValueCollectionの容量は、NameValueCollectionが保持できる要素の数です。 要素が NameValueCollectionに追加されると、内部配列を再割り当てすることで、必要に応じて容量が自動的に増加します。

コレクションのサイズを見積もることができる場合、初期容量を指定すると、 NameValueCollectionに要素を追加するときに、多数のサイズ変更操作を実行する必要がなくなります。

ハッシュ コード プロバイダーは、 NameValueCollection内のキーのハッシュ コードを分配します。 既定のハッシュ コード プロバイダーは CaseInsensitiveHashCodeProviderです。

比較子は、2 つのキーが等しいかどうかを判断します。 既定の比較子は CaseInsensitiveComparerです。

新しい NameValueCollection の要素は、ソース NameValueCollectionと同じ順序で並べ替えられます。

このコンストラクターは O(n) 操作です。ここで、 ncol内の要素の数です。

こちらもご覧ください

適用対象

NameValueCollection(Int32)

ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs

空の NameValueCollection クラスの新しいインスタンスを初期化し、指定された初期容量を持ち、既定の大文字と小文字を区別しないハッシュ コード プロバイダーと既定の大文字と小文字を区別しない比較子を使用します。

public:
 NameValueCollection(int capacity);
public NameValueCollection(int capacity);
new System.Collections.Specialized.NameValueCollection : int -> System.Collections.Specialized.NameValueCollection
Public Sub New (capacity As Integer)

パラメーター

capacity
Int32

NameValueCollectionに含めることができるエントリの初期数。

例外

capacity が 0 未満です。

注釈

NameValueCollectionの容量は、NameValueCollectionが保持できる要素の数です。 要素が NameValueCollectionに追加されると、内部配列を再割り当てすることで、必要に応じて容量が自動的に増加します。

コレクションのサイズを見積もることができる場合、初期容量を指定すると、 NameValueCollectionに要素を追加するときに、多数のサイズ変更操作を実行する必要がなくなります。

ハッシュ コード プロバイダーは、 NameValueCollection内のキーのハッシュ コードを分配します。 既定のハッシュ コード プロバイダーは CaseInsensitiveHashCodeProviderです。

比較子は、2 つのキーが等しいかどうかを判断します。 既定の比較子は CaseInsensitiveComparerです。

このコンストラクターは O(n) 操作であり、 ncapacity

こちらもご覧ください

適用対象

NameValueCollection(IHashCodeProvider, IComparer)

ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs

注意事項

This constructor has been deprecated. Use NameValueCollection(IEqualityComparer) instead.

注意事項

Please use NameValueCollection(IEqualityComparer) instead.

空の NameValueCollection クラスの新しいインスタンスを初期化し、既定の初期容量を持ち、指定したハッシュ コード プロバイダーと指定された比較子を使用します。

public:
 NameValueCollection(System::Collections::IHashCodeProvider ^ hashProvider, System::Collections::IComparer ^ comparer);
[System.Obsolete("This constructor has been deprecated. Use NameValueCollection(IEqualityComparer) instead.")]
public NameValueCollection(System.Collections.IHashCodeProvider? hashProvider, System.Collections.IComparer? comparer);
[System.Obsolete("Please use NameValueCollection(IEqualityComparer) instead.")]
public NameValueCollection(System.Collections.IHashCodeProvider? hashProvider, System.Collections.IComparer? comparer);
[System.Obsolete("Please use NameValueCollection(IEqualityComparer) instead.")]
public NameValueCollection(System.Collections.IHashCodeProvider hashProvider, System.Collections.IComparer comparer);
public NameValueCollection(System.Collections.IHashCodeProvider hashProvider, System.Collections.IComparer comparer);
[<System.Obsolete("This constructor has been deprecated. Use NameValueCollection(IEqualityComparer) instead.")>]
new System.Collections.Specialized.NameValueCollection : System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameValueCollection
[<System.Obsolete("Please use NameValueCollection(IEqualityComparer) instead.")>]
new System.Collections.Specialized.NameValueCollection : System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameValueCollection
new System.Collections.Specialized.NameValueCollection : System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameValueCollection
Public Sub New (hashProvider As IHashCodeProvider, comparer As IComparer)

パラメーター

hashProvider
IHashCodeProvider

IHashCodeProvider内のすべてのキーのハッシュ コードを提供するNameValueCollection

comparer
IComparer

2 つのキーが等しいかどうかを判断するために使用する IComparer

属性

注釈

NameValueCollectionの容量は、NameValueCollectionが保持できる要素の数です。 要素が NameValueCollectionに追加されると、内部配列を再割り当てすることで、必要に応じて容量が自動的に増加します。

コレクションのサイズを見積もることができる場合、初期容量を指定すると、 NameValueCollectionに要素を追加するときに、多数のサイズ変更操作を実行する必要がなくなります。

ハッシュ コード プロバイダーは、 NameValueCollection内のキーのハッシュ コードを分配します。 既定のハッシュ コード プロバイダーは CaseInsensitiveHashCodeProviderです。

比較子は、2 つのキーが等しいかどうかを判断します。 既定の比較子は CaseInsensitiveComparerです。

このコンストラクターは O(1) 操作です。

こちらもご覧ください

適用対象

NameValueCollection(Int32, IEqualityComparer)

ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs

空の NameValueCollection クラスの新しいインスタンスを初期化し、指定した初期容量を持ち、指定した IEqualityComparer オブジェクトを使用します。

public:
 NameValueCollection(int capacity, System::Collections::IEqualityComparer ^ equalityComparer);
public NameValueCollection(int capacity, System.Collections.IEqualityComparer equalityComparer);
public NameValueCollection(int capacity, System.Collections.IEqualityComparer? equalityComparer);
new System.Collections.Specialized.NameValueCollection : int * System.Collections.IEqualityComparer -> System.Collections.Specialized.NameValueCollection
Public Sub New (capacity As Integer, equalityComparer As IEqualityComparer)

パラメーター

capacity
Int32

NameValueCollection オブジェクトに含めることができるエントリの初期数。

equalityComparer
IEqualityComparer

2 つのキーが等しいかどうかを判断し、コレクション内のキーのハッシュ コードを生成するために使用する IEqualityComparer オブジェクト。

例外

capacity が 0 未満です。

注釈

NameValueCollection オブジェクトの容量は、NameValueCollectionが保持できる要素の数です。 要素が NameValueCollectionに追加されると、内部配列を再割り当てすることで、必要に応じて容量が自動的に増加します。

コレクションのサイズを見積もることができる場合、初期容量を指定すると、 NameValueCollectionに要素を追加するときに、多数のサイズ変更操作を実行する必要がなくなります。

IEqualityComparer オブジェクトは、比較子とハッシュ コード プロバイダーを結合します。 ハッシュ コード プロバイダーは、 NameValueCollection内のキーのハッシュ コードを分配します。 比較子は、2 つのキーが等しいかどうかを判断します。

このコンストラクターは O(n) 操作であり、 ncapacity パラメーターです。

こちらもご覧ください

適用対象

NameValueCollection(Int32, NameValueCollection)

ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs

指定した NameValueCollection のエントリを新しい NameValueCollection にコピーします。初期容量は、コピーされたエントリの数のいずれか大きい方と同じで、既定の大文字と小文字を区別しないハッシュ コード プロバイダーと既定の大文字と小文字を区別しない比較子を使用します。

public:
 NameValueCollection(int capacity, System::Collections::Specialized::NameValueCollection ^ col);
public NameValueCollection(int capacity, System.Collections.Specialized.NameValueCollection col);
new System.Collections.Specialized.NameValueCollection : int * System.Collections.Specialized.NameValueCollection -> System.Collections.Specialized.NameValueCollection
Public Sub New (capacity As Integer, col As NameValueCollection)

パラメーター

capacity
Int32

NameValueCollectionに含めることができるエントリの初期数。

col
NameValueCollection

新しいNameValueCollection インスタンスにコピーするNameValueCollection

例外

capacity が 0 未満です。

colnullです。

注釈

NameValueCollectionの容量は、NameValueCollectionが保持できる要素の数です。 要素が NameValueCollectionに追加されると、内部配列を再割り当てすることで、必要に応じて容量が自動的に増加します。

コレクションのサイズを見積もることができる場合、初期容量を指定すると、 NameValueCollectionに要素を追加するときに、多数のサイズ変更操作を実行する必要がなくなります。

ハッシュ コード プロバイダーは、 NameValueCollection内のキーのハッシュ コードを分配します。 既定のハッシュ コード プロバイダーは CaseInsensitiveHashCodeProviderです。

比較子は、2 つのキーが等しいかどうかを判断します。 既定の比較子は CaseInsensitiveComparerです。

このコンストラクターは O(n) 操作であり、 ncapacitycol内の要素の数がcapacityを超える場合、このコンストラクターは O(n + m) 操作になります。ここで、ncapacityされ、mcol内の要素の数になります。

こちらもご覧ください

適用対象

NameValueCollection(SerializationInfo, StreamingContext)

ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs

注意事項

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

シリアル化可能で、指定したNameValueCollectionSerializationInfoを使用するStreamingContext クラスの新しいインスタンスを初期化します。

protected:
 NameValueCollection(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 NameValueCollection(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected NameValueCollection(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.NameValueCollection : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Collections.Specialized.NameValueCollection
new System.Collections.Specialized.NameValueCollection : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Collections.Specialized.NameValueCollection
Protected Sub New (info As SerializationInfo, context As StreamingContext)

パラメーター

info
SerializationInfo

新しいSerializationInfo インスタンスのシリアル化に必要な情報を格納するNameValueCollection オブジェクト。

context
StreamingContext

新しいStreamingContext インスタンスに関連付けられたシリアル化ストリームのソースと宛先を格納するNameValueCollection オブジェクト。

属性

注釈

このコンストラクターは O(1) 操作です。

こちらもご覧ください

適用対象

NameValueCollection(Int32, IHashCodeProvider, IComparer)

ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs
ソース:
NameValueCollection.cs

注意事項

This constructor has been deprecated. Use NameValueCollection(Int32, IEqualityComparer) instead.

注意事項

Please use NameValueCollection(Int32, IEqualityComparer) instead.

空の NameValueCollection クラスの新しいインスタンスを初期化し、指定した初期容量を持ち、指定したハッシュ コード プロバイダーと指定された比較子を使用します。

public:
 NameValueCollection(int capacity, System::Collections::IHashCodeProvider ^ hashProvider, System::Collections::IComparer ^ comparer);
[System.Obsolete("This constructor has been deprecated. Use NameValueCollection(Int32, IEqualityComparer) instead.")]
public NameValueCollection(int capacity, System.Collections.IHashCodeProvider? hashProvider, System.Collections.IComparer? comparer);
[System.Obsolete("Please use NameValueCollection(Int32, IEqualityComparer) instead.")]
public NameValueCollection(int capacity, System.Collections.IHashCodeProvider? hashProvider, System.Collections.IComparer? comparer);
[System.Obsolete("Please use NameValueCollection(Int32, IEqualityComparer) instead.")]
public NameValueCollection(int capacity, System.Collections.IHashCodeProvider hashProvider, System.Collections.IComparer comparer);
public NameValueCollection(int capacity, System.Collections.IHashCodeProvider hashProvider, System.Collections.IComparer comparer);
[<System.Obsolete("This constructor has been deprecated. Use NameValueCollection(Int32, IEqualityComparer) instead.")>]
new System.Collections.Specialized.NameValueCollection : int * System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameValueCollection
[<System.Obsolete("Please use NameValueCollection(Int32, IEqualityComparer) instead.")>]
new System.Collections.Specialized.NameValueCollection : int * System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameValueCollection
new System.Collections.Specialized.NameValueCollection : int * System.Collections.IHashCodeProvider * System.Collections.IComparer -> System.Collections.Specialized.NameValueCollection
Public Sub New (capacity As Integer, hashProvider As IHashCodeProvider, comparer As IComparer)

パラメーター

capacity
Int32

NameValueCollectionに含めることができるエントリの初期数。

hashProvider
IHashCodeProvider

IHashCodeProvider内のすべてのキーのハッシュ コードを提供するNameValueCollection

comparer
IComparer

2 つのキーが等しいかどうかを判断するために使用する IComparer

属性

例外

capacity が 0 未満です。

注釈

NameValueCollectionの容量は、NameValueCollectionが保持できる要素の数です。 要素が NameValueCollectionに追加されると、内部配列を再割り当てすることで、必要に応じて容量が自動的に増加します。

コレクションのサイズを見積もることができる場合、初期容量を指定すると、 NameValueCollectionに要素を追加するときに、多数のサイズ変更操作を実行する必要がなくなります。

ハッシュ コード プロバイダーは、 NameValueCollection内のキーのハッシュ コードを分配します。 既定のハッシュ コード プロバイダーは CaseInsensitiveHashCodeProviderです。

比較子は、2 つのキーが等しいかどうかを判断します。 既定の比較子は CaseInsensitiveComparerです。

このコンストラクターは O(n) 操作であり、 ncapacity

こちらもご覧ください

適用対象