EAPConvert Methods |
The EAPConvert type exposes the following members.
Name | Description | |
---|---|---|
DataTableToXml |
Serializes a DataTable structure and data to an XML representation.
Use XmlToDataTable(String) to reconstitute the DataTable from the XML.
| |
FilePatternToRegex |
Converts a file search pattern to a RegEx expression.
| |
FromHex |
Converts a hex string to an integer. The hex can optionally be prefixed with "0x".
| |
FromUnixTimeSeconds |
Convert the object to a DateTime value handling the case when the object is null or DBNull.
| |
HtmlToPlainText |
Convert HTML to a decent plain-text representation.
| |
NumToWords |
Convert a number into its corresponding words (e.g. 1234 to "one thousand, two hundred and thirty-four" in English).
| |
PackH |
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.
| |
ParseDateTime(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. | |
ParseDateTime(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. | |
PhoneToE164 |
Convert a phone number string to an E.164 formatted phone number.
| |
TagStringToMap(String, Char) |
Convert a tag string (name=value pairs) to a string map mapping name to value.
| |
TagStringToMap(String, Char, Char) |
Convert a tag string (name=value pairs) to a string map mapping name to value.
| |
ToBool |
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.
| |
ToDateDesc |
Generate a text description for a date, e.g. "(Today)", suitable for appending to date/time field renderings.
| |
ToDateTime(Object) |
Convert the object to a DateTime value handling the case when the object is null or DBNull.
| |
ToDateTime(Object, Boolean) |
Convert the object to a DateTime value handling the case when the object is null or DBNull.
| |
ToDateTime(Object, DateTime) |
Convert the object to a DateTime value handling the case when the object is null or DBNull.
| |
ToDateTime(Object, DateTime, Boolean) |
Convert the object to a DateTime value handling the case when the object is null or DBNull.
| |
ToGuid |
Convert an object to a GUID. Currently a Guid, Guid?, string or null/DBNull is expected
and most other value types return null.
| |
ToHex(Enum) |
Convert an enum into a hex string with a "0x" prefix.
| |
ToHex(Int32) |
Convert an integer to a hex string with a "0x" prefix.
| |
ToInt16(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.
| |
ToInt16(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.
| |
ToInt64(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.
| |
ToInt64(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.
| |
ToListAlpha |
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.
| |
ToRadixString |
Convert long value to Radix string
| |
ToRawString |
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).
| |
ToRoman |
Convert a number to its Roman Numeral representation.
Any number outside the range 1 to 3999 will result in a null/blank string.
| |
TotalHoursToTimeSpan |
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.
| |
TryParseDateTime |
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.
| |
Version(FileVersionInfo) |
Return the EAP scaled version for a .Net FileVersionInfo.
| |
Version(Object) |
Return the EAP scaled version for an object.
| |
Version(Version) |
Return the EAP scaled version for a .Net Version.
| |
Version(Int32, Boolean) |
Return the version string for the specified scaled version.
| |
XmlToDataTable |
Creates an populates a DataTable from XML reprenting the original DataTable created by DataTableToXml(DataTable).
|