ParseLong() public static method

Attempt to parse a string representation of a long.
public static ParseLong ( string value ) : long
value string
return long
Ejemplo n.º 1
0
        public static long ReadInt64(NetworkBinaryReader reader)
        {
            object value = ReadNonnullObject("long", reader);

            if (value is long || value is int || value is short || value is byte)
            {
                return((long)value);
            }
            if (value is string)
            {
                return(PrimitiveParser.ParseLong((string)value));
            }
            throw PrimitiveParser.CreateProtocolViolationException("long", value);
        }
Ejemplo n.º 2
0
        public static long ReadInt64(NetworkBinaryReader reader)
        {
            object value = ReadNonnullObject("long", reader);

            if (value is long || value is int || value is short || value is byte)
            {
                return((long)value);
            }
            if (value is string)
            {
                return(PrimitiveParser.ParseLong((string)value));
            }
            PrimitiveParser.InvalidConversion("long", value);
            return(0);
        }