示例#1
0
        public void TestClassWithNullableTimeSpan()
        {
            var value = new ClassWithNullableTimeSpan
            {
                Value = TimeSpan.FromSeconds(1.5)
            };

            _serializer.ShouldRoundtrip(value);
        }
示例#2
0
        public static void WriteValueNotNull(BinaryWriter writer, ClassWithNullableTimeSpan obj, ISerializer serializer)
        {
            var tmp = obj.Value.HasValue;

            writer.Write(tmp);
            if (tmp)
            {
                writer.Write(obj.Value.Value.Ticks);
            }
        }