Esempio n. 1
0
            internal static void Serialize(object input, ISerializationContext context, Type expected)
            {
                ReportingPOCO instance = (ReportingPOCO)input;

                SerializationManager.SerializeInner(instance.A, context, typeof(int));
                SerializationManager.SerializeInner(instance.B, context, typeof(int));
                SerializationManager.SerializeInner(instance.CopyCount, context, typeof(int));
                SerializationManager.SerializeInner(instance.SerializeCount + 1, context, typeof(int));
                SerializationManager.SerializeInner(instance.DeserializeCount, context, typeof(int));
            }
Esempio n. 2
0
            public static object DeepCopier(object original, ICopyContext context)
            {
                ReportingPOCO instance = (ReportingPOCO)original;

                int a                = (int)SerializationManager.DeepCopyInner(instance.A, context);
                int b                = (int)SerializationManager.DeepCopyInner(instance.B, context);
                int copyCount        = (int)SerializationManager.DeepCopyInner(instance.CopyCount, context);
                int serializeCount   = (int)SerializationManager.DeepCopyInner(instance.SerializeCount, context);
                int deserializeCount = (int)SerializationManager.DeepCopyInner(instance.DeserializeCount, context);

                return(new ReportingPOCO {
                    A = a, B = b, CopyCount = copyCount + 1, SerializeCount = serializeCount, DeserializeCount = deserializeCount
                });
            }