Class ChoiceOptionCollection
An ordered collection of ChoiceOption entries backing a choice field's /Opt array (spec §12.7.3).
Inherited Members
Namespace: DRIT.Pdf.Forms
Assembly: DRIT.Pdf.dll
Syntax
public sealed class ChoiceOptionCollection : IEnumerable<ChoiceOption>, IEnumerable
Properties
Count
Gets the number of options in this collection.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
this[int]
Gets the option at the specified index.
Declaration
public ChoiceOption this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index. |
Property Value
| Type | Description |
|---|---|
| ChoiceOption |
Methods
Add(ChoiceOption)
Adds a pre-constructed ChoiceOption.
Declaration
public void Add(ChoiceOption option)
Parameters
| Type | Name | Description |
|---|---|---|
| ChoiceOption | option | The option to add. |
Add(string)
Adds a simple option whose export and display values are identical.
Declaration
public void Add(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The text used for both export and display. |
Add(string, string)
Adds an option with distinct export and display values.
Declaration
public void Add(string exportValue, string displayValue)
Parameters
| Type | Name | Description |
|---|---|---|
| string | exportValue | The value submitted when this option is selected. |
| string | displayValue | The text shown to the user. |
Clear()
Removes all options from this collection.
Declaration
public void Clear()
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<ChoiceOption> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<ChoiceOption> | An enumerator that can be used to iterate through the collection. |
RemoveAt(int)
Removes the option at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index. |