OrderedDictionary コンストラクター
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
OrderedDictionary クラスの新しいインスタンスを初期化します。
オーバーロード
| 名前 | 説明 |
|---|---|
| OrderedDictionary() |
OrderedDictionary クラスの新しいインスタンスを初期化します。 |
| OrderedDictionary(IEqualityComparer) |
指定した比較子を使用して、 OrderedDictionary クラスの新しいインスタンスを初期化します。 |
| OrderedDictionary(Int32) |
指定した初期容量を使用して、 OrderedDictionary クラスの新しいインスタンスを初期化します。 |
| OrderedDictionary(Int32, IEqualityComparer) |
指定した初期容量と比較子を使用して、 OrderedDictionary クラスの新しいインスタンスを初期化します。 |
| OrderedDictionary(SerializationInfo, StreamingContext) |
古い.
指定したOrderedDictionaryオブジェクトとSerializationInfo オブジェクトを使用してシリアル化可能なStreamingContext クラスの新しいインスタンスを初期化します。 |
OrderedDictionary()
OrderedDictionary クラスの新しいインスタンスを初期化します。
public:
OrderedDictionary();
public OrderedDictionary();
Public Sub New ()
例
次のコード例は、 OrderedDictionary コレクションの作成と作成を示しています。 このコードは、 OrderedDictionaryで表示できる大規模なコード例の一部です。
// Creates and initializes a OrderedDictionary.
OrderedDictionary myOrderedDictionary = new OrderedDictionary();
myOrderedDictionary.Add("testKey1", "testValue1");
myOrderedDictionary.Add("testKey2", "testValue2");
myOrderedDictionary.Add("keyToDelete", "valueToDelete");
myOrderedDictionary.Add("testKey3", "testValue3");
ICollection keyCollection = myOrderedDictionary.Keys;
ICollection valueCollection = myOrderedDictionary.Values;
// Display the contents using the key and value collections
DisplayContents(keyCollection, valueCollection, myOrderedDictionary.Count);
' Creates and initializes a OrderedDictionary.
Dim myOrderedDictionary As New OrderedDictionary()
myOrderedDictionary.Add("testKey1", "testValue1")
myOrderedDictionary.Add("testKey2", "testValue2")
myOrderedDictionary.Add("keyToDelete", "valueToDelete")
myOrderedDictionary.Add("testKey3", "testValue3")
Dim keyCollection As ICollection = myOrderedDictionary.Keys
Dim valueCollection As ICollection = myOrderedDictionary.Values
' Display the contents Imports the key and value collections
DisplayContents( _
keyCollection, valueCollection, myOrderedDictionary.Count)
注釈
比較子は、2 つのキーが等しいかどうかを判断します。 OrderedDictionary コレクション内のすべてのキーは一意である必要があります。 既定の比較子は、 Object.Equalsのキーの実装です。
適用対象
OrderedDictionary(IEqualityComparer)
指定した比較子を使用して、 OrderedDictionary クラスの新しいインスタンスを初期化します。
public:
OrderedDictionary(System::Collections::IEqualityComparer ^ comparer);
public OrderedDictionary(System.Collections.IEqualityComparer comparer);
public OrderedDictionary(System.Collections.IEqualityComparer? comparer);
new System.Collections.Specialized.OrderedDictionary : System.Collections.IEqualityComparer -> System.Collections.Specialized.OrderedDictionary
Public Sub New (comparer As IEqualityComparer)
パラメーター
- comparer
- IEqualityComparer
2 つのキーが等しいかどうかを判断するために使用する IComparer 。
-又は-
null は、各キーの Equals(Object)の実装である既定の比較子を使用します。
注釈
比較子は、2 つのキーが等しいかどうかを判断します。 OrderedDictionary コレクション内のすべてのキーは一意である必要があります。 既定の比較子は、 Object.Equalsのキーの実装です。
カスタム 比較子を使用すると、大文字と小文字を区別しない文字列を使用して検索を行うなどのシナリオが可能になります。
適用対象
OrderedDictionary(Int32)
指定した初期容量を使用して、 OrderedDictionary クラスの新しいインスタンスを初期化します。
public:
OrderedDictionary(int capacity);
public OrderedDictionary(int capacity);
new System.Collections.Specialized.OrderedDictionary : int -> System.Collections.Specialized.OrderedDictionary
Public Sub New (capacity As Integer)
パラメーター
- capacity
- Int32
OrderedDictionary コレクションに含めることができる要素の初期数。
注釈
比較子は、2 つのキーが等しいかどうかを判断します。 OrderedDictionary コレクション内のすべてのキーは一意である必要があります。 既定の比較子は、 Object.Equalsのキーの実装です。
適用対象
OrderedDictionary(Int32, IEqualityComparer)
指定した初期容量と比較子を使用して、 OrderedDictionary クラスの新しいインスタンスを初期化します。
public:
OrderedDictionary(int capacity, System::Collections::IEqualityComparer ^ comparer);
public OrderedDictionary(int capacity, System.Collections.IEqualityComparer comparer);
public OrderedDictionary(int capacity, System.Collections.IEqualityComparer? comparer);
new System.Collections.Specialized.OrderedDictionary : int * System.Collections.IEqualityComparer -> System.Collections.Specialized.OrderedDictionary
Public Sub New (capacity As Integer, comparer As IEqualityComparer)
パラメーター
- capacity
- Int32
OrderedDictionary コレクションに含めることができる要素の初期数。
- comparer
- IEqualityComparer
2 つのキーが等しいかどうかを判断するために使用する IComparer 。
-又は-
null は、各キーの Equals(Object)の実装である既定の比較子を使用します。
注釈
比較子は、2 つのキーが等しいかどうかを判断します。 OrderedDictionary コレクション内のすべてのキーは一意である必要があります。 既定の比較子は、 Object.Equalsのキーの実装です。
カスタム 比較子を使用すると、大文字と小文字を区別しない文字列を使用して検索を行うなどのシナリオが可能になります。
適用対象
OrderedDictionary(SerializationInfo, StreamingContext)
注意事項
This API supports obsolete formatter-based serialization. It should not be called or extended by application code.
指定したOrderedDictionaryオブジェクトとSerializationInfo オブジェクトを使用してシリアル化可能なStreamingContext クラスの新しいインスタンスを初期化します。
protected:
OrderedDictionary(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 OrderedDictionary(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected OrderedDictionary(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.OrderedDictionary : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Collections.Specialized.OrderedDictionary
new System.Collections.Specialized.OrderedDictionary : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Collections.Specialized.OrderedDictionary
Protected Sub New (info As SerializationInfo, context As StreamingContext)
パラメーター
- info
- SerializationInfo
SerializationInfo コレクションのシリアル化に必要な情報を格納しているOrderedDictionary オブジェクト。
- context
- StreamingContext
StreamingContextに関連付けられたシリアル化ストリームのソースと宛先を格納しているOrderedDictionary オブジェクト。
- 属性
注釈
比較子は、2 つのキーが等しいかどうかを判断します。 OrderedDictionary コレクション内のすべてのキーは一意である必要があります。 既定の比較子は、 Object.Equalsのキーの実装です。