DictionaryEntry.Value DictionaryEntry.Value DictionaryEntry.Value DictionaryEntry.Value Property

정의

키/값 쌍에서 값을 가져오거나 설정합니다.Gets or sets the value in the key/value pair.

public:
 property System::Object ^ Value { System::Object ^ get(); void set(System::Object ^ value); };
public object Value { get; set; }
member this.Value : obj with get, set
Public Property Value As Object

속성 값

키/값 쌍의 값입니다.The value in the key/value pair.

예제

다음 예제는 Value 속성입니다.The following example demonstrates the Value property. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 DictionaryEntry 클래스입니다.This code example is part of a larger example provided for the DictionaryEntry class.

public:
    virtual void Add(Object^ key, Object^ value)
    {
        // Add the new key/value pair even if this key already exists
        // in the dictionary.
        if (itemsInUse == items->Length)
        {
            throw gcnew InvalidOperationException
                ("The dictionary cannot hold any more items.");
        }
        items[itemsInUse++] = gcnew DictionaryEntry(key, value);
    }
public void Add(object key, object value) 
{
    // Add the new key/value pair even if this key already exists in the dictionary.
    if (ItemsInUse == items.Length)
        throw new InvalidOperationException("The dictionary cannot hold any more items.");
    items[ItemsInUse++] = new DictionaryEntry(key, value);
}
Public Sub Add(ByVal key As Object, ByVal value As Object) Implements IDictionary.Add

    ' Add the new key/value pair even if this key already exists in the dictionary.
    If ItemsInUse = items.Length Then
        Throw New InvalidOperationException("The dictionary cannot hold any more items.")
    End If
    items(ItemsInUse) = New DictionaryEntry(key, value)
    ItemsInUse = ItemsInUse + 1
End Sub

적용 대상