GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    DictionaryBase<TKey, TValue> Class

    Namespace:
    GemBox.Document
    Assembly:
    GemBox.Document.dll

    Provides a base class for generic dictionary.

    • C#
    • VB.NET
    public abstract class DictionaryBase<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
    Public MustInherit Class DictionaryBase(Of TKey, TValue)
        Implements IDictionary(Of TKey, TValue), ICollection(Of KeyValuePair(Of TKey, TValue)), IEnumerable(Of KeyValuePair(Of TKey, TValue)), IEnumerable
    Type Parameters
    TKey

    The type of the key.

    TValue

    The type of the value.

    Inheritance:
    System.Object
    DictionaryBase<TKey, TValue>
    Derived
    BuiltInDocumentPropertiesDictionary
    CustomDocumentPropertiesDictionary
    FieldMappingDictionary
    VariablesDictionary
    Implements
    System.Collections.Generic.IDictionary<TKey, TValue>
    System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>
    System.Collections.IEnumerable
    Remarks

    This class is used as a base class for BuiltInDocumentPropertiesDictionary, CustomDocumentPropertiesDictionary and FieldMappingDictionary classes.

    Properties

    Count

    Gets the number of key/value pairs contained in the DictionaryBase<TKey, TValue>.

    • C#
    • VB.NET
    public int Count { get; }
    Public ReadOnly Property Count As Integer
    Property Value
    System.Int32

    The number of key/value pairs contained in the DictionaryBase<TKey, TValue>.

    Item[TKey]

    Gets or sets the value associated with the specified key.

    • C#
    • VB.NET
    public TValue this[TKey key] { get; set; }
    Public Property Item(key As TKey) As TValue
    Parameters
    key
    TKey

    The key of the value to get or set.

    Property Value
    TValue

    The value associated with the specified key.

    Keys

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

    • C#
    • VB.NET
    public ICollection<TKey> Keys { get; }
    Public ReadOnly Property Keys As ICollection(Of TKey)
    Property Value
    System.Collections.Generic.ICollection<TKey>

    A collection containing the keys in the DictionaryBase<TKey, TValue>.

    Values

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

    • C#
    • VB.NET
    public ICollection<TValue> Values { get; }
    Public ReadOnly Property Values As ICollection(Of TValue)
    Property Value
    System.Collections.Generic.ICollection<TValue>

    A collection containing the values in the DictionaryBase<TKey, TValue>.

    Methods

    Add(TKey, TValue)

    Adds the specified key and value to the DictionaryBase<TKey, TValue>.

    • C#
    • VB.NET
    public void Add(TKey key, TValue value)
    Public Sub Add(key As TKey, value As TValue)
    Parameters
    key
    TKey

    The key of the element to add.

    value
    TValue

    The value of the element to add.

    Clear()

    Removes all keys and values from the DictionaryBase<TKey, TValue>.

    • C#
    • VB.NET
    public void Clear()
    Public Sub Clear

    ContainsKey(TKey)

    Determines whether the DictionaryBase<TKey, TValue> contains the specified key.

    • C#
    • VB.NET
    public bool ContainsKey(TKey key)
    Public Function ContainsKey(key As TKey) As Boolean
    Parameters
    key
    TKey

    The key to locate in the DictionaryBase<TKey, TValue>.

    Returns
    System.Boolean

    true if the DictionaryBase<TKey, TValue> contains an element with the specified key; otherwise, false.

    GetEnumerator()

    Returns an enumerator that iterates through the DictionaryBase<TKey, TValue>.

    • C#
    • VB.NET
    public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
    Public Function GetEnumerator As IEnumerator(Of KeyValuePair(Of TKey, TValue))
    Returns
    System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>>

    An enumerator that can be used to iterate through the DictionaryBase<TKey, TValue>.

    Remove(TKey)

    Removes the value with the specified key from the DictionaryBase<TKey, TValue>.

    • C#
    • VB.NET
    public bool Remove(TKey key)
    Public Function Remove(key As TKey) As Boolean
    Parameters
    key
    TKey

    The key of the element to remove.

    Returns
    System.Boolean

    true if the element is successfully found and removed; otherwise, false. This method returns false if key is not found in the DictionaryBase<TKey, TValue>.

    TryGetValue(TKey, out TValue)

    Gets the value associated with the specified key.

    • C#
    • VB.NET
    public bool TryGetValue(TKey key, out TValue value)
    Public Function TryGetValue(key As TKey, ByRef value As TValue) As Boolean
    Parameters
    key
    TKey

    The key of the value to get.

    value
    TValue

    When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

    Returns
    System.Boolean

    true if the DictionaryBase<TKey, TValue> contains an element with the specified key; otherwise, false.

    Implements

    System.Collections.Generic.IDictionary<TKey, TValue>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.