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

    Show / Hide Table of Contents

    DocumentPropertiesDictionary<TKey, TValue> Class

    Namespace:
    GemBox.Presentation
    Assembly:
    GemBox.Presentation.dll

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

    • C#
    • VB.NET
    public abstract class DocumentPropertiesDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
    Public MustInherit Class DocumentPropertiesDictionary(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
    DocumentPropertiesDictionary<TKey, TValue>
    Derived
    BuiltInDocumentPropertiesDictionary
    CustomDocumentPropertiesDictionary
    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

    Properties

    Count

    Gets the number of key/value pairs contained in the DocumentPropertiesDictionary<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 DocumentPropertiesDictionary<TKey, TValue>.

    IsReadOnly

    Gets a value indicating whether the collection is read-only.

    • C#
    • VB.NET
    public bool IsReadOnly { get; }
    Public ReadOnly Property IsReadOnly As Boolean
    Property Value
    System.Boolean

    true if the collection is read-only; otherwise, false.

    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.

    Exceptions
    System.ArgumentException

    Value is either null or its type is not supported.

    Keys

    Gets a collection containing the keys in the DocumentPropertiesDictionary<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 DocumentPropertiesDictionary<TKey, TValue>.

    Values

    Gets a collection containing the values in the DocumentPropertiesDictionary<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 DocumentPropertiesDictionary<TKey, TValue>.

    Methods

    Add(TKey, TValue)

    Adds an element with the provided key and value to the collection.

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

    The object to use as the key of the element to add.

    value
    TValue

    The object to use as the value of the element to add.

    Exceptions
    System.ArgumentException

    Value is either null or its type is not supported.

    Clear()

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

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

    ContainsKey(TKey)

    Determines whether the DocumentPropertiesDictionary<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 DocumentPropertiesDictionary<TKey, TValue>.

    Returns
    System.Boolean

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

    GetEnumerator()

    Returns an enumerator that iterates through the DocumentPropertiesDictionary<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 DocumentPropertiesDictionary<TKey, TValue>.

    Remove(TKey)

    Removes the value with the specified key from the DocumentPropertiesDictionary<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 DocumentPropertiesDictionary<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 DocumentPropertiesDictionary<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

    Examples

    Document Properties Example
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.