Class OptionalContentCollection<T>
A read-only wrapper that returns an empty or populated collection.
Used for nullable collection properties (e.g. Page.AssociatedFiles).
Inheritance
OptionalContentCollection<T>
Assembly: DRIT.Pdf.dll
Syntax
public sealed class OptionalContentCollection<T> : IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
| Name |
Description |
| T |
The element type.
|
Properties
Count
Declaration
public int Count { get; }
Property Value
Empty
Declaration
public static OptionalContentCollection<T> Empty { get; }
Property Value
HasValue
Whether the collection has any items.
Declaration
public bool HasValue { get; }
Property Value
this[int]
Declaration
public T this[int index] { get; }
Parameters
| Type |
Name |
Description |
| int |
index |
|
Property Value
Methods
From(IReadOnlyList<T>)
Creates a populated optional collection from a list.
Declaration
public static OptionalContentCollection<T> From(IReadOnlyList<T> items)
Parameters
Returns
GetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
Implements