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

Class OptionalContentCollection<T>

A read-only wrapper that returns an empty or populated collection. Used for nullable collection properties (e.g. Page.AssociatedFiles).

Inheritance
object
OptionalContentCollection<T>
Implements
IReadOnlyList<T>
IReadOnlyCollection<T>
IEnumerable<T>
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 OptionalContentCollection<T> : IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
Name Description
T

The element type.

Properties

Count

Number of items.

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

Empty

An empty collection.

Declaration
public static OptionalContentCollection<T> Empty { get; }
Property Value
Type Description
OptionalContentCollection<T>

HasValue

Whether the collection has any items.

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

this[int]

Indexed accessor.

Declaration
public T this[int index] { get; }
Parameters
Type Name Description
int index
Property Value
Type Description
T

Methods

From(IReadOnlyList<T>)

Creates a populated optional collection from a list.

Declaration
public static OptionalContentCollection<T> From(IReadOnlyList<T> items)
Parameters
Type Name Description
IReadOnlyList<T> items
Returns
Type Description
OptionalContentCollection<T>

GetEnumerator()

Returns an enumerator.

Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type Description
IEnumerator<T>

Implements

IReadOnlyList<T>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable
Back to top

DR-IT Software documentation

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

Generated by DocFX