Click or drag to resize

EAPConvert Methods

The EAPConvert type exposes the following members.

Methods
  NameDescription
Public methodStatic memberDataTableToXml
Serializes a DataTable structure and data to an XML representation. Use XmlToDataTable(String) to reconstitute the DataTable from the XML.
Public methodStatic memberFilePatternToRegex
Converts a file search pattern to a RegEx expression.
Public methodStatic memberFromHex
Converts a hex string to an integer. The hex can optionally be prefixed with "0x".
Public methodStatic memberFromUnixTimeSeconds
Convert the object to a DateTime value handling the case when the object is null or DBNull.
Public methodStatic memberHtmlToPlainText
Convert HTML to a decent plain-text representation.
Public methodStatic memberNumToWords
Convert a number into its corresponding words (e.g. 1234 to "one thousand, two hundred and thirty-four" in English).
Public methodStatic memberPackH
Converts an ASCII hex string encoding of binary data to its corresponding array of bytes. This provides equivalent functionality to the PHP Pack('H') method.
Public methodStatic memberParseDateTime(String, String, CultureInfo)
Converts the specified string representation of a date and time to its DateTime equivalent using the specified culture-specific format information. Note that if time is provide without a date specification, then the date will be defaulted to 1899-12-30 (the COM time-only date). Note also that internal whitespace is ignored.

Internally both DateTime.TryParseExact() and DateTime.TryParse() are used to provide wider conversion coverage. This is particularly important for time-only values.

Public methodStatic memberParseDateTime(String, String, CultureInfo, DateTime)
Converts the specified string representation of a date and time to its DateTime equivalent using the specified culture-specific format information. Note that if time is provide without a date specification, then the date will be defaulted to 1899-12-30 (the COM time-only date). Note also that internal whitespace is ignored.

Internally both DateTime.TryParseExact() and DateTime.TryParse() are used to provide wider conversion coverage. This is particularly important for time-only values.

Public methodStatic memberPhoneToE164
Convert a phone number string to an E.164 formatted phone number.
Public methodStatic memberTagStringToMap(String, Char)
Convert a tag string (name=value pairs) to a string map mapping name to value.
Public methodStatic memberTagStringToMap(String, Char, Char)
Convert a tag string (name=value pairs) to a string map mapping name to value.
Public methodStatic memberToBool
Convert an object to a bool handling the case when the object is null or DBNull. When the object is null, a numeric zero, or a string that is empty, "0", or "false" then false, is returned.
Public methodStatic memberToDateDesc
Generate a text description for a date, e.g. "(Today)", suitable for appending to date/time field renderings.
Public methodStatic memberToDateTime(Object)
Convert the object to a DateTime value handling the case when the object is null or DBNull.
Public methodStatic memberToDateTime(Object, Boolean)
Convert the object to a DateTime value handling the case when the object is null or DBNull.
Public methodStatic memberToDateTime(Object, DateTime)
Convert the object to a DateTime value handling the case when the object is null or DBNull.
Public methodStatic memberToDateTime(Object, DateTime, Boolean)
Convert the object to a DateTime value handling the case when the object is null or DBNull.
Public methodStatic memberToGuid
Convert an object to a GUID. Currently a Guid, Guid?, string or null/DBNull is expected and most other value types return null.
Public methodStatic memberToHex(Enum)
Convert an enum into a hex string with a "0x" prefix.
Public methodStatic memberToHex(Int32)
Convert an integer to a hex string with a "0x" prefix.
Public methodStatic memberToInt16(Object)
Convert an object to an int16 handling the case when the object is DBNull. When the object is null or an empty string, the return value is 0.
Public methodStatic memberToInt16(Object, Int16)
Convert an object to an int16 handling the case when the object is DBNull. When the object is null, the return value is the value of the defaultValue parameter.
Public methodStatic memberToInt64(Object)
Convert an object to an int64 handling the case when the object is DBNull. When the object is null or an empty string, the return value is 0.
Public methodStatic memberToInt64(Object, Int64)
Convert an object to an int64 handling the case when the object is DBNull. When the object is null, the return value is the value of the defaultValue parameter.
Public methodStatic memberToListAlpha
Convert a number to its alphabetic representation as used in lists, bullet items, and similar. For example, "a" for 1, "b" for 2, ... "z" for 26, "aa" for 27, etc. A negative number or zero will result in a null/blank string.
Public methodStatic memberToRadixString
Convert long value to Radix string
Public methodStatic memberToRawString
Convert an object to a string in its raw format. In particular this means that boolean values are converted to "0" and "1", and enumerations are converted to their underlying int values as a string, not the name of the enumeration value(s).
Public methodStatic memberToRoman
Convert a number to its Roman Numeral representation. Any number outside the range 1 to 3999 will result in a null/blank string.
Public methodStatic memberTotalHoursToTimeSpan
Create a TimeSpan object representing the specified number of total hours. The value may be greater than 24 and may include fractional hours. Note that at this time any sub-second portion is discarded.
Public methodStatic memberTryParseDateTime
Converts the specified string representation of a date and time to its DateTime equivalent using the specified culture-specific format information. Note that if time is provide without a date specification, no default date is supplied. Note also that internal whitespace is ignored. Internally both DateTime.TryParseExact() and DateTime.TryParse() are used to provide wider conversion coverage. This is particularly important for time-only values.
Public methodStatic memberVersion(FileVersionInfo)
Return the EAP scaled version for a .Net FileVersionInfo.
Public methodStatic memberVersion(Object)
Return the EAP scaled version for an object.
Public methodStatic memberVersion(Version)
Return the EAP scaled version for a .Net Version.
Public methodStatic memberVersion(Int32, Boolean)
Return the version string for the specified scaled version.
Public methodStatic memberXmlToDataTable
Creates an populates a DataTable from XML reprenting the original DataTable created by DataTableToXml(DataTable).
Top
See Also