Class PortfolioFieldCollection
Dictionary-like collection of portfolio schema fields.
Inherited Members
Namespace: DRIT.Pdf.EmbeddedFiles
Assembly: DRIT.Pdf.dll
Syntax
public sealed class PortfolioFieldCollection : IEnumerable<KeyValuePair<string, PortfolioField>>, IEnumerable
Properties
Count
Gets the number of fields in this collection.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
this[string]
Gets the field with the specified key.
Declaration
public PortfolioField this[string key] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The field key. |
Property Value
| Type | Description |
|---|---|
| PortfolioField |
Methods
Add(PortfolioFieldDataType, string)
Adds a new field with the specified data type and key.
Declaration
public KeyValuePair<string, PortfolioField> Add(PortfolioFieldDataType dataType, string key)
Parameters
| Type | Name | Description |
|---|---|---|
| PortfolioFieldDataType | dataType | The data type for the field. |
| string | key | The field key (must be unique). |
Returns
| Type | Description |
|---|---|
| KeyValuePair<string, PortfolioField> | A key-value pair containing the key and the created field. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when key is null, empty, or already exists. |
GetEnumerator()
Returns an enumerator for iterating over fields.
Declaration
public IEnumerator<KeyValuePair<string, PortfolioField>> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<KeyValuePair<string, PortfolioField>> |
TryGetValue(string, out PortfolioField)
Attempts to get a field by key.
Declaration
public bool TryGetValue(string key, out PortfolioField field)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The field key. |
| PortfolioField | field | The field if found, or null. |
Returns
| Type | Description |
|---|---|
| bool | True if the field was found; false otherwise. |