Пример #1
0
        protected override void InitExistingField(BinaryReader reader, Func <string, Type> typeResolver)
        {
            base.InitExistingField(reader, typeResolver);

            BaseField fld = FieldFromReader(StateStore, reader, typeResolver);

            _deltaField = fld as ScaledDeltaField;
            if (_deltaField == null)
            {
                throw new SerializerException(
                          "Unexpected field {0} was deserialized instead of {1}", fld,
                          typeof(ScaledDeltaField).ToDebugStr());
            }

            ValidateDivider(TimeDivider);
        }
Пример #2
0
        /// <summary>
        /// Integer and Float delta serializer.
        /// </summary>
// ReSharper disable UnusedParameter.Local
        public UtcDateTimeField([NotNull] IStateStore serializer, Type valueType, string stateName)
// ReSharper restore UnusedParameter.Local
            : base(Versions.Ver0, serializer, typeof(UtcDateTime), stateName)
        {
            _deltaField = new ScaledDeltaField(serializer, typeof(long), stateName);
        }