Пример #1
0
        private static Object ReadIntegral(BinaryParser parser, Type type)
        {
            var result = ReadIntegral(parser, Type.GetTypeCode(type));

            if (result == null)
            {
                BinaryParserException.ThrowUnknownType(type);
            }

            return(result);
        }
Пример #2
0
        private static void ValidateSignature(FieldInfo field, Object value)
        {
            var magic = BinaryParser.GetAttribute <MagicSignatureAttribute>(field);

            if (magic != null)
            {
                if (!Equals(value, magic.Signature))
                {
                    BinaryParserException.ThrowSignatureException();
                }
            }
        }