[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.PdfEnum-1

Struct PdfEnum<TEnum>

Namespace
GrapeCity.Documents.Pdf
Assembly
GcDocs.Pdf.dll

Represents a PDF enumeration type.

public struct PdfEnum<TEnum> : IEquatable<PdfEnum<TEnum>> where TEnum : struct

Type Parameters

TEnum
Implements
System.IEquatable<T><PdfEnum<TEnum>>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

Constructors

PdfEnum(TEnum)

Initializes a new instance of the PdfEnum<TEnum> struct using a TEnum value.

public PdfEnum(TEnum value)

Parameters

value TEnum

The TEnum value.

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

PdfEnum(PdfName)

Initializes a new instance of the PdfEnum<TEnum> struct using a PdfName object. The passed PdfName is converted to TEnum if possible.

public PdfEnum(PdfName value)

Parameters

value PdfName

The string representing a TEnum value.

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

PdfEnum(string)

Initializes a new instance of the PdfEnum<TEnum> struct using a string. The passed string is converted to TEnum if possible.

public PdfEnum(string value)

Parameters

value string

The string representing a TEnum value.

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

Properties

EnumValue

Gets the TEnum value defined by this PdfEnum<TEnum>. Throws an exception if this PdfEnum<TEnum> is represented by an unparsed PDF value.

public TEnum EnumValue { get; }

Property Value

TEnum

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

IsPdfValue

Gets a value indicating whether this PdfEnum<TEnum> struct contains a PDF value which cannot be converted to PdfEnum<TEnum>.

public bool IsPdfValue { get; }

Property Value

bool

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

IsString

Gets a value indicating whether this PdfEnum<TEnum> struct contains a string value which cannot be converted to PdfEnum<TEnum>.

[Obsolete("Use IsPdfValue")]
public bool IsString { get; }

Property Value

bool

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

PdfValue

Gets the PDF value defined by this PdfEnum<TEnum>. Throws an exception if this PdfEnum<TEnum> is represented by a parsed TEnum value.

public PdfName PdfValue { get; }

Property Value

PdfName

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

Methods

Equals(TEnum)

Checks whether this PdfEnum<TEnum> is equal to TEnum value.

public bool Equals(TEnum other)

Parameters

other TEnum

The TEnum value to compare to.

Returns

bool

True if the values are equal, false otherwise.

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

Equals(PdfEnum<TEnum>)

Checks whether this PdfEnum<TEnum> is equal to another PdfEnum<TEnum>.

public bool Equals(PdfEnum<TEnum> other)

Parameters

other PdfEnum<TEnum>

The PdfEnum<TEnum> value to compare to.

Returns

bool

True if the values are equal, false otherwise.

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

Equals(PdfEnum<TEnum>?, TEnum?)

Returns true if nullable PdfEnum<TEnum> equals to nullable TEnum value.

public static bool Equals(PdfEnum<TEnum>? v1, TEnum? v2)

Parameters

v1 PdfEnum<TEnum>?
v2 TEnum?

Returns

bool

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

GetEnumValue(TEnum)

Returns the EnumValue if IsString is false, defValue otherwise.

public TEnum GetEnumValue(TEnum defValue)

Parameters

defValue TEnum

The default value if this PdfEnum<TEnum> has no enumeration value.

Returns

TEnum

EnumValue if IsString is false, defValue otherwise.

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

GetHashCode()

public override int GetHashCode()

Returns

int

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

ToString()

public override string ToString()

Returns

string

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

Operators

operator ==(PdfEnum<TEnum>, PdfEnum<TEnum>)

Equality operator.

public static bool operator ==(PdfEnum<TEnum> v1, PdfEnum<TEnum> v2)

Parameters

v1 PdfEnum<TEnum>
v2 PdfEnum<TEnum>

Returns

bool

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

implicit operator PdfEnum<TEnum>(TEnum)

Converts a TEnum value to PdfEnum<TEnum>.

public static implicit operator PdfEnum<TEnum>(TEnum value)

Parameters

value TEnum

The value to convert.

Returns

PdfEnum<TEnum>

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

implicit operator TEnum(PdfEnum<TEnum>)

Converts a PdfEnum<TEnum> value to TEnum.

public static implicit operator TEnum(PdfEnum<TEnum> value)

Parameters

value PdfEnum<TEnum>

The value to convert.

Returns

TEnum

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

operator !=(PdfEnum<TEnum>, PdfEnum<TEnum>)

Inequality operator.

public static bool operator !=(PdfEnum<TEnum> v1, PdfEnum<TEnum> v2)

Parameters

v1 PdfEnum<TEnum>
v2 PdfEnum<TEnum>

Returns

bool

Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.