[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.Spec.IPdfDictExt.GetEnum

GetEnum Method

GetEnum<T>(IPdfDict, PdfName, T?)

Gets the nullable enum value associated with the specified key. If the value does not exist or cannot be converted to an enum, returns defValue (which can be null).

Declaration
public static T? GetEnum<T>(this IPdfDict dict, PdfName key, T? defValue) where T : struct
Public Shared Function GetEnum(Of T As Structure)(dict As IPdfDict, key As PdfName, defValue As T?) As T?
Parameters
Type Name Description
IPdfDict dict

The current dictionary.

PdfName key

The key identifying the value.

T? defValue

The default value.

Returns
Type Description
T?

The value associated with the specified key, or defValue.

Type Parameters
Name Description
T

GetEnum<T>(IPdfDict, PdfName, T)

Gets the enum value associated with the specified key. If the value does not exist or cannot be converted to an enum, returns defValue.

Declaration
public static T GetEnum<T>(this IPdfDict dict, PdfName key, T defValue) where T : struct
Public Shared Function GetEnum(Of T As Structure)(dict As IPdfDict, key As PdfName, defValue As T) As T
Parameters
Type Name Description
IPdfDict dict

The current dictionary.

PdfName key

The key identifying the value.

T defValue

The default value.

Returns
Type Description
T

The value associated with the specified key, or defValue.

Type Parameters
Name Description
T