コード例 #1
0
 private void WriteObjectWithoutTypeDescription(BinaryWriter writer, object value, Type valueType)
 {
     if (context.IsReservedType(valueType))
     {
         WriteReservedType(writer, value, valueType);
     }
     else
     {
         var slotDestination = new SlotDestination();
         var pofWriter       = new PofWriter(context, slotDestination);
         ((IPortableObject)value).Serialize(pofWriter);
         slotDestination.WriteToWriter(writer);
     }
 }
コード例 #2
0
 private void WriteObjectWithoutTypeDescription <T>(BinaryWriter writer, T value)
 {
     if (context.IsReservedType(typeof(T)))
     {
         WriteReservedType(writer, value);
     }
     else
     {
         var slotDestination = new SlotDestination();
         var pofWriter       = new PofWriter(context, slotDestination);
         pofWriter.WriteToSlots((IPortableObject)value);
         slotDestination.WriteToWriter(writer);
     }
 }