Compartilhar via


DataCollection<TKey,TValue> Class

Definition

Represents a collection of keys and values.

generic <typename TKey, typename TValue>
public ref class DataCollection abstract : System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<TKey, TValue>>
[System.Serializable]
public abstract class DataCollection<TKey,TValue> : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>
[<System.Serializable>]
type DataCollection<'Key, 'Value> = class
    interface seq<KeyValuePair<'Key, 'Value>>
    interface IEnumerable
Public MustInherit Class DataCollection(Of TKey, TValue)
Implements IEnumerable(Of KeyValuePair(Of TKey, TValue))

Type Parameters

TKey

The type of the keys in the dictionary.

TValue

The type of the values in the dictionary.

Inheritance
DataCollection<TKey,TValue>
Derived
Attributes
Implements

Constructors

DataCollection<TKey,TValue>()

Initializes a new instance of the DataCollection<TKey,TValue> class.

DataCollection<TKey,TValue>(IDictionary<TKey,TValue>)

Properties

Count

Gets the number of elements in the collection.

IsReadOnly

Gets a value indicating whether the DataCollection<TKey,TValue> is read-only.

Item[TKey]

Gets or sets the value associated with the specified key.

Keys

Gets a collection containing the keys in the DataCollection<TKey,TValue>.

Values

Gets a collection containing the values in the DataCollection<TKey,TValue>.

Methods

Add(KeyValuePair<TKey,TValue>)

Adds the specified key and value to the dictionary.

Add(TKey, TValue)

Adds the specified key and value to the dictionary.

AddRange(IEnumerable<KeyValuePair<TKey,TValue>>)

Adds the elements of the specified collection to the end of the DataCollection<TKey,TValue>.

AddRange(KeyValuePair<TKey,TValue>[])

Adds the elements of the specified collection to the end of the DataCollection<TKey,TValue>.

Clear()

Removes all items from the DataCollection<TKey,TValue>.

Contains(KeyValuePair<TKey,TValue>)

Determines whether the DataCollection<TKey,TValue> contains a specific value.

Contains(TKey)

Determines whether the DataCollection<TKey,TValue> contains a specific value.

ContainsKey(TKey)

Determines whether the DataCollection<TKey,TValue> contains a specific key value.

CopyTo(KeyValuePair<TKey,TValue>[], Int32)
GetEnumerator()

Returns an enumerator that iterates through a collection.

Remove(KeyValuePair<TKey,TValue>)

Removes the first occurrence of a specific object from the DataCollection<TKey,TValue>.

Remove(TKey)

Removes the first occurrence of a specific object from the DataCollection<TKey,TValue>.

TryGetValue(TKey, TValue)

Gets the value associated with the specified key.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through the collection.

Applies to