iTextSharp.xmp.XmpUtils.ConvertToLong C# (CSharp) Method

ConvertToLong() public static method

Converts a string value to a long.
/// If the rawValue is null or empty or the /// conversion fails.
public static ConvertToLong ( string rawValue ) : long
rawValue string /// the string value
return long
        public static long ConvertToLong(string rawValue) {
            try {
                if (string.IsNullOrEmpty(rawValue)) {
                    throw new XmpException("Empty convert-string", XmpError.BADVALUE);
                }
                if (rawValue.StartsWith("0x")) {
                    return Convert.ToInt64(rawValue.Substring(2), 16);
                }
                return Convert.ToInt64(rawValue);
            }
            catch (FormatException) {
                throw new XmpException("Invalid long string", XmpError.BADVALUE);
            }
        }