Table of Contents

Class Union<A, B>

Namespace
UglyToad.PdfPig.Core
Assembly
UglyToad.PdfPig.Core.dll

Defines a type which is a union of two types.

public abstract class Union<A, B>

Type Parameters

A
B
Inheritance
Union<A, B>
Derived
Union<A, B>.Case1
Union<A, B>.Case2
Inherited Members

Methods

Match(Action<A>, Action<B>)

Take an action for the item of the given type.

public abstract void Match(Action<A> first, Action<B> second)

Parameters

first Action<A>
second Action<B>

Match<TResult>(Func<A, TResult>, Func<B, TResult>)

Run a func against the item of the given type.

public abstract TResult Match<TResult>(Func<A, TResult> first, Func<B, TResult> second)

Parameters

first Func<A, TResult>
second Func<B, TResult>

Returns

TResult

Type Parameters

TResult

One(A)

Create a value of the first type.

public static Union<A, B>.Case1 One(A item)

Parameters

item A

Returns

Union<A, B>.Case1

TryGetFirst(out A)

Get the item if it is of the specific type.

public abstract bool TryGetFirst(out A a)

Parameters

a A

Returns

bool

TryGetSecond(out B)

Get the item if it is of the specific type.

public abstract bool TryGetSecond(out B b)

Parameters

b B

Returns

bool

Two(B)

Create a value of the second type.

public static Union<A, B>.Case2 Two(B item)

Parameters

item B

Returns

Union<A, B>.Case2