ParseShort() public static method

Attempt to parse a string representation of a short.
public static ParseShort ( string value ) : short
value string
return short
Example #1
0
        public static short ReadInt16(NetworkBinaryReader reader)
        {
            object value = ReadNonnullObject("short", reader);

            if (value is short || value is byte)
            {
                return((short)value);
            }
            if (value is string)
            {
                return(PrimitiveParser.ParseShort((string)value));
            }
            throw PrimitiveParser.CreateProtocolViolationException("short", value);
        }
        public static short ReadInt16(NetworkBinaryReader reader)
        {
            object value = ReadNonnullObject("short", reader);

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