Show / Hide Table of Contents

# Class DictIterator

DictIterator is used to traverse key-value pairs in a dictionary. DictIterator can be used to print out all the entries in a given Obj dictionary as follows:

    DictIterator itr = dict.getDictIterator();
       while (itr.hasCurrent()) {
       Obj key = itr.key();
       printf(key.getName());
       Obj value = itr.value();
       //...
       itr.next()
       }
       }

##### Inheritance

object
DictIterator
NameTreeIterator
NumberTreeIterator

##### Implements

IDisposable

##### Inherited Members

object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

###### Namespace: pdftron.SDF

###### Assembly: PDFTronDotNet.dll

##### Syntax

    public class DictIterator : IDisposable

### Methods

#### Destroy()

##### Declaration

    public void Destroy()

#### Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

##### Declaration

    public void Dispose()

#### Dispose(bool)

##### Declaration

    protected virtual void Dispose(bool disposing)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | disposing |

#### Equals(object)

checks if equals to the specified `DictIterator` object

##### Declaration

    public override bool Equals(object rhs)

##### Parameters

Type | Name | Description
--- | --- | ---
object | rhs | specified `DictIterator`

##### Returns

Type | Description
--- | ---
bool | true if both are equal

##### Overrides

object.Equals(object)

#### ~DictIterator()

Releases all resources used by the DictIterator

##### Declaration

    protected ~DictIterator()

#### HasCurrent()

Checks if the current iterator is valid.

##### Declaration

    public bool HasCurrent()

##### Returns

Type | Description
--- | ---
bool | true if the current iterator is not at the end of the collection.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### HasNext()

Checks if the current iterator is valid.

##### Declaration

    [Obsolete("Deprecated, use HasCurrent() as a replacement.")]
    public bool HasNext()

##### Returns

Type | Description
--- | ---
bool | true if the current iterator is not at the end of the collection.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Key()

Key

##### Declaration

    public Obj Key()

##### Returns

Type | Description
--- | ---
Obj | key of the current dictionary entry

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Next()

Advances the iterator to the next element of the collection.

##### Declaration

    public void Next()

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Set(DictIterator)

Sets value to the specified `DictIterator`

##### Declaration

    public void Set(DictIterator p)

##### Parameters

Type | Name | Description
--- | --- | ---
DictIterator | p | another `DictIterator` object

#### Value()

Value

##### Declaration

    public Obj Value()

##### Returns

Type | Description
--- | ---
Obj | value of the current dictionary entry

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### op_Assign(DictIterator)

Assignment operator

##### Declaration

    public DictIterator op_Assign(DictIterator rhs)

##### Parameters

Type | Name | Description
--- | --- | ---
DictIterator | rhs | `DictIterator` at the right side of the operator

##### Returns

Type | Description
--- | ---
DictIterator | `DictIterator` that equals to the object at the right side of the operator

### Operators

#### operator ==(DictIterator, DictIterator)

Equality operator checks whether two `DictIterator` objects are the same.

##### Declaration

    public static bool operator ==(DictIterator lhs, DictIterator rhs)

##### Parameters

Type | Name | Description
--- | --- | ---
DictIterator | lhs | `DictIterator` at the left side of the operator
DictIterator | rhs | `DictIterator` at the right side of the operator

##### Returns

Type | Description
--- | ---
bool | true if both objects are equal, false otherwise

#### operator !=(DictIterator, DictIterator)

Inequality operator checks whether two `DictIterator` objects are different.

##### Declaration

    public static bool operator !=(DictIterator lhs, DictIterator rhs)

##### Parameters

Type | Name | Description
--- | --- | ---
DictIterator | lhs | `DictIterator` at the left side of the operator
DictIterator | rhs | `DictIterator` at the right side of the operator

##### Returns

Type | Description
--- | ---
bool | true if both objects are not equal, false otherwise

### Implements

IDisposable