예제 #1
0
 private static void WriteOrSerializeInner <T>(T val, BinaryTokenStreamWriter writer) where T : class
 {
     if (val == null)
     {
         writer.WriteNull();
     }
     else
     {
         SerializationManager.SerializeInner(val, writer, val.GetType());
     }
 }
예제 #2
0
        /// <summary>
        /// Serialize the event sequence token.
        /// </summary>
        /// <param name="untypedInput">The object to serialize.</param>
        /// <param name="writer">The writer to write the binary stream to.</param>
        /// <param name="expected">The expected type.</param>
        public static void Serialize(object untypedInput, BinaryTokenStreamWriter writer, Type expected)
        {
            var typed = untypedInput as EventSequenceTokenV2;

            if (typed == null)
            {
                writer.WriteNull();
                return;
            }

            writer.Write(typed.SequenceNumber);
            writer.Write(typed.EventIndex);
        }
예제 #3
0
 public void Serialize(object item, BinaryTokenStreamWriter writer, Type expectedType)
 {
     SerializeCalled = true;
     writer.WriteNull();
 }