OrderedDictionary 생성자

정의

OrderedDictionary 클래스의 새 인스턴스를 초기화합니다.

오버로드

OrderedDictionary()

OrderedDictionary 클래스의 새 인스턴스를 초기화합니다.

OrderedDictionary(IEqualityComparer)

지정한 비교자를 사용하여 OrderedDictionary 클래스의 새 인스턴스를 초기화합니다.

OrderedDictionary(Int32)

지정한 초기 용량을 사용하여 OrderedDictionary 클래스의 새 인스턴스를 초기화합니다.

OrderedDictionary(Int32, IEqualityComparer)

지정한 초기 용량과 비교자를 사용하여 OrderedDictionary 클래스의 새 인스턴스를 초기화합니다.

OrderedDictionary(SerializationInfo, StreamingContext)
사용되지 않음.

지정한 OrderedDictionarySerializationInfo 개체를 사용하여 serialize할 수 있는 StreamingContext 클래스의 새 인스턴스를 초기화합니다.

OrderedDictionary()

Source:
OrderedDictionary.cs
Source:
OrderedDictionary.cs
Source:
OrderedDictionary.cs

OrderedDictionary 클래스의 새 인스턴스를 초기화합니다.

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

예제

다음 코드 예제에서는 컬렉션의 생성 및 모집단을 OrderedDictionary 보여 줍니다. 이 코드는 에서 OrderedDictionary볼 수 있는 더 큰 코드 예제의 일부입니다.

// Creates and initializes a OrderedDictionary.
OrderedDictionary^ myOrderedDictionary = gcnew 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.
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)

설명

비교자는 두 키가 같은지 여부를 결정합니다. 컬렉션의 모든 키는 OrderedDictionary 고유해야 합니다. 기본 비교자는 키의 구현입니다 Object.Equals.

적용 대상

OrderedDictionary(IEqualityComparer)

Source:
OrderedDictionary.cs
Source:
OrderedDictionary.cs
Source:
OrderedDictionary.cs

지정한 비교자를 사용하여 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

두 키가 같은지 여부를 확인하는 데 사용하는 IComparer입니다.

또는

각 키로 Equals(Object)를 구현한 기본 비교자를 사용하면 null입니다.

설명

비교자는 두 키가 같은지 여부를 결정합니다. 컬렉션의 모든 키는 OrderedDictionary 고유해야 합니다. 기본 비교자는 키의 구현입니다 Object.Equals.

사용자 지정 비교자를 사용하면 대/소문자를 구분하지 않는 문자열을 사용하여 조회를 수행하는 등의 시나리오를 사용할 수 있습니다.

적용 대상

OrderedDictionary(Int32)

Source:
OrderedDictionary.cs
Source:
OrderedDictionary.cs
Source:
OrderedDictionary.cs

지정한 초기 용량을 사용하여 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 컬렉션에 포함될 수 있는 초기 요소 수입니다.

설명

비교자는 두 키가 같은지 여부를 결정합니다. 컬렉션의 모든 키는 OrderedDictionary 고유해야 합니다. 기본 비교자는 키의 구현입니다 Object.Equals.

적용 대상

OrderedDictionary(Int32, IEqualityComparer)

Source:
OrderedDictionary.cs
Source:
OrderedDictionary.cs
Source:
OrderedDictionary.cs

지정한 초기 용량과 비교자를 사용하여 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

두 키가 같은지 여부를 확인하는 데 사용하는 IComparer입니다.

또는

각 키로 Equals(Object)를 구현한 기본 비교자를 사용하면 null입니다.

설명

비교자는 두 키가 같은지 여부를 결정합니다. 컬렉션의 모든 키는 OrderedDictionary 고유해야 합니다. 기본 비교자는 키의 구현입니다 Object.Equals.

사용자 지정 비교자를 사용하면 대/소문자를 구분하지 않는 문자열을 사용하여 조회를 수행하는 등의 시나리오를 사용할 수 있습니다.

적용 대상

OrderedDictionary(SerializationInfo, StreamingContext)

Source:
OrderedDictionary.cs
Source:
OrderedDictionary.cs
Source:
OrderedDictionary.cs

주의

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

지정한 OrderedDictionarySerializationInfo 개체를 사용하여 serialize할 수 있는 StreamingContext 클래스의 새 인스턴스를 초기화합니다.

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

매개 변수

info
SerializationInfo

SerializationInfo 컬렉션을 serialize하는 데 필요한 정보가 들어 있는 OrderedDictionary 개체입니다.

context
StreamingContext

StreamingContext와 관련하여 serialize된 스트림의 소스와 대상이 포함된 OrderedDictionary개체입니다.

특성

설명

비교자는 두 키가 같은지 여부를 결정합니다. 컬렉션의 모든 키는 OrderedDictionary 고유해야 합니다. 기본 비교자는 키의 구현입니다 Object.Equals.

적용 대상