이 문서는 기계로 번역한 것입니다. 원본 텍스트를 보려면 포인터를 문서의 문장 위로 올리십시오. 추가 정보
번역
원본
이 항목은 아직 평가되지 않았습니다.- 이 항목 평가

DictionaryEntry 구조체

설정하거나 검색할 수 있는 사전 키/값 쌍을 정의합니다.

네임스페이스:  System.Collections
어셈블리:  mscorlib(mscorlib.dll)
[SerializableAttribute]
[ComVisibleAttribute(true)]
public struct DictionaryEntry

DictionaryEntry 형식에서는 다음과 같은 멤버를 노출합니다.

  이름설명
Public 메서드XNA Framework에서 지원이식 가능한 클래스 라이브러리에서 지원Windows 스토어 앱용 .NET에서 지원DictionaryEntry지정된 키와 값을 사용하여 DictionaryEntry 형식의 인스턴스를 초기화합니다.
위쪽
  이름설명
Public 속성XNA Framework에서 지원이식 가능한 클래스 라이브러리에서 지원Windows 스토어 앱용 .NET에서 지원Key키/값 쌍에서 키를 가져오거나 설정합니다.
Public 속성XNA Framework에서 지원이식 가능한 클래스 라이브러리에서 지원Windows 스토어 앱용 .NET에서 지원Value키/값 쌍에서 값을 가져오거나 설정합니다.
위쪽
  이름설명
Public 메서드XNA Framework에서 지원이식 가능한 클래스 라이브러리에서 지원Windows 스토어 앱용 .NET에서 지원Equals이 인스턴스와 지정된 개체가 같은지 여부를 나타냅니다. (ValueType에서 상속됨)
Public 메서드XNA Framework에서 지원이식 가능한 클래스 라이브러리에서 지원Windows 스토어 앱용 .NET에서 지원GetHashCode해당 인스턴스에 대한 해시 코드를 반환합니다. (ValueType에서 상속됨)
Public 메서드XNA Framework에서 지원이식 가능한 클래스 라이브러리에서 지원Windows 스토어 앱용 .NET에서 지원GetType현재 인스턴스의 Type을 가져옵니다. (Object에서 상속됨)
Public 메서드XNA Framework에서 지원ToString이 인스턴스의 정규화된 형식 이름을 반환합니다. (ValueType에서 상속됨)

XNA Framework 3.0에서 이 멤버는 Object에서 상속됩니다..ToString().
위쪽

IDictionaryEnumerator.Entry 메서드는 이 형식의 인스턴스를 반환합니다.

C# 언어의 foreach 문(Visual C++의 경우 for each, Visual Basic의 경우 For Each)에는 컬렉션의 각 요소 형식이 필요합니다. IDictionary 의 각 요소가 키/값 쌍이므로 요소 형식은 키의 형식도, 값의 형식도 아닙니다. 대신 요소 형식은 DictionaryEntry입니다. 예를 들면 다음과 같습니다.


foreach (DictionaryEntry de in openWith)
{
    Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value);
}


foreach 문은 열거자를 둘러싸는 래퍼로 컬렉션에서 읽기만 가능하고 컬렉션에 쓰는 것은 허용되지 않습니다.

다음 예제에서는 DictionaryEntry를 사용하여 Hashtable 개체를 반복하는 방법을 보여 줍니다.


// A simple example for the DictionaryEntry structure.
using System;
using System.Collections;

class Example
{
    public static void Main()
    {
        // Create a new hash table.
        //
        Hashtable openWith = new Hashtable();

        // Add some elements to the hash table. There are no 
        // duplicate keys, but some of the values are duplicates.
        openWith.Add("txt", "notepad.exe");
        openWith.Add("bmp", "paint.exe");
        openWith.Add("dib", "paint.exe");
        openWith.Add("rtf", "wordpad.exe");

        // When you use foreach to enumerate hash table elements,
        // the elements are retrieved as KeyValuePair objects.
        Console.WriteLine();
        foreach (DictionaryEntry de in openWith)
        {
            Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value);
        }
    }
}

/* This code example produces output similar to the following:

Key = rtf, Value = wordpad.exe
Key = txt, Value = notepad.exe
Key = dib, Value = paint.exe
Key = bmp, Value = paint.exe
 */


.NET Framework

4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0에서 지원

.NET Framework Client Profile

4, 3.5 SP1에서 지원

이식 가능한 클래스 라이브러리

이식 가능한 클래스 라이브러리에서 지원

Windows 스토어 앱용 .NET

Windows 8에서 지원

Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008(서버 코어 역할은 지원되지 않음), Windows Server 2008 R2(서버 코어 역할은 SP1 이상에서 지원, Itanium은 지원되지 않음)

.NET Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
이 형식의 모든 공용 static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.
이 정보가 도움이 되었습니까?
(1500자 남음)

커뮤니티 추가 항목

추가
© 2013 Microsoft. All rights reserved.