DocumentPropertiesDictionary<TKey, TValue> Class
This class is used as a base class for BuiltInDocumentPropertiesDictionary and CustomDocumentPropertiesDictionary classes.
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.ObjectDocumentPropertiesDictionary<TKey, TValue>
- Derived
Implements
Properties
Count
Gets the number of key/value pairs contained in the DocumentPropertiesDictionary<TKey, TValue>.
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.
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.
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>.
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>.
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.
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>.
ContainsKey(TKey)
Determines whether the DocumentPropertiesDictionary<TKey, TValue> contains the specified key.
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>.
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>.
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.
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
.