Exemple #1
0
 public static Nested.Any0 WriteToTS(object obj)
 {
     Nested.Any0 ab = new Nested.Any0();
     ab.dataKey = ".root";
     BinarySerializable.GetByInstance(obj).WriteTo(obj, ab);
     return(ab);
 }
Exemple #2
0
        public void BytesToAnyValue()
        {
            if (string.IsNullOrEmpty(typeName))
            {
                return;
            }

            var rt = new RefType(typeName);

            MonoSerialize.MergeFrom(rt.Instance, bytes, objs);

            anyValue = MonoSerialize.WriteToTS(rt.Instance);
        }
Exemple #3
0
        public void SaveToTS()
        {
            if (string.IsNullOrEmpty(typeName))
            {
                return;
            }

            var rt = new RefType(typeName);

            MonoSerialize.MergeFrom(rt.Instance, bytes, objs);
            anyValue    = MonoSerialize.WriteToTS(rt.Instance);
            bytesCrc32  = Crc32.To(bytes);
            bytesLength = bytes.Length;
        }
Exemple #4
0
        public void OnBeforeSerialize()
        {
            if (instance == null)
            {
                if (string.IsNullOrEmpty(typeName))
                {
                    bytes = null;
                    if (objs != null)
                    {
                        objs.Clear();
                    }
                    else
                    {
                        objs = new List <Object>();
                    }
                    refType_ = null;
                    instance = null;
#if !CloseNested
                    bytesLength = 0;
                    bytesCrc32  = 0;
                    anyValue    = null;
#endif
                }
            }
            else
            {
                if (!isDllChange())
                {
                    var ms = MonoSerialize.WriteTo(instance);
                    bytes = ms.GetBytes();
                    objs  = ms.objs;
#if !CloseNested
                    bytesCrc32 = Crc32.To(bytes);
                    var ab = MonoSerialize.WriteToTS(instance);
                    Nested.Any0.Blend(ab, anyValue);
                    anyValue    = (Nested.Any0)ab.clone();
                    bytesLength = bytes.Length;
#endif
                }
                else
                {
                    refType_ = null;
                    instance = null;
                }
            }
        }
Exemple #5
0
 public void ResetNested()
 {
     anyValue    = null;
     bytesCrc32  = 0;
     bytesLength = 0;
 }
Exemple #6
0
 public void ResetNested()
 {
     anyValue = null;
 }
Exemple #7
0
 public static void Blend(Any0 now, Any0 old)
 {
     AnyBase.Blend(now, old);
 }