• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class Tree<TKey, TValue>

A PDF name or number tree (spec §7.9.7). This is a simplified flat (leaf-only) implementation suitable for document-level name trees such as /Names /EmbeddedFiles and /Names /Dests.

Inheritance
object
Tree<TKey, TValue>
Implements
IEnumerable<KeyValuePair<TKey, TValue>>
IEnumerable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Pdf
Assembly: DRIT.Pdf.dll
Syntax
public sealed class Tree<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable where TKey : notnull
Type Parameters
Name Description
TKey
TValue

Properties

Count

Number of entries in the tree.

Declaration
public int Count { get; }
Property Value
Type Description
int

HasEntries

Whether the tree has any entries.

Declaration
public bool HasEntries { get; }
Property Value
Type Description
bool

this[TKey]

Gets or sets a value by key.

Declaration
public TValue this[TKey key] { get; set; }
Parameters
Type Name Description
TKey key
Property Value
Type Description
TValue

Keys

Returns all keys.

Declaration
public IEnumerable<TKey> Keys { get; }
Property Value
Type Description
IEnumerable<TKey>

Values

Returns all values.

Declaration
public IEnumerable<TValue> Values { get; }
Property Value
Type Description
IEnumerable<TValue>

Methods

Add(TKey, TValue)

Adds a key-value pair. Throws if the key already exists.

Declaration
public void Add(TKey key, TValue value)
Parameters
Type Name Description
TKey key
TValue value

Clear()

Clears all entries.

Declaration
public void Clear()

GetEnumerator()

Returns an enumerator over key-value pairs.

Declaration
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
Returns
Type Description
IEnumerator<KeyValuePair<TKey, TValue>>

Remove(TKey)

Removes a key. Returns true if the key was found.

Declaration
public bool Remove(TKey key)
Parameters
Type Name Description
TKey key
Returns
Type Description
bool

TryGetValue(TKey, out TValue)

Tries to get a value by key.

Declaration
public bool TryGetValue(TKey key, out TValue value)
Parameters
Type Name Description
TKey key
TValue value
Returns
Type Description
bool

Implements

IEnumerable<T>
IEnumerable
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX