Exemple #1
0
 public override void Clone(ref TItem[] value)
 {
     value = (TItem[])value.Clone();
     for (int i = 0; i < value.Length; i++)
     {
         m_itemSerializer.Clone(ref value[i]);
     }
 }
Exemple #2
0
        public override void Clone(ref TOwner original, ref TOwner clone)
        {
            TMember value;

            m_getter(ref original, out value);
            m_serializer.Clone(ref value);
            m_setter(ref clone, ref value);
        }
Exemple #3
0
 public override void Clone(ref T?value)
 {
     // Values types inside can have references, must clone properly
     if (value.HasValue)
     {
         T val = value.Value;
         m_serializer.Clone(ref val);
         value = val;
     }
 }
        public override void Clone(ref TOwner original, ref TOwner clone)
        {
#if !XB1 // XB1_SYNC_SERIALIZER_NOEMIT
            TMember value;
            m_getter(ref original, out value);
            m_serializer.Clone(ref value);
            m_setter(ref clone, ref value);
#else // XB1
            System.Diagnostics.Debug.Assert(false, "TODO for XB1.");
#endif // XB1
        }
Exemple #5
0
        public override void Clone(ref HashSet <TItem> value)
        {
            TItem item;
            var   copy = new HashSet <TItem>();

            foreach (var obj in value)
            {
                item = obj;
                m_itemSerializer.Clone(ref item);
                copy.Add(item);
            }
            value = copy;
        }
Exemple #6
0
        public override void Clone(ref List <TItem> value)
        {
            TItem item;
            var   copy = new List <TItem>(value.Count);

            for (int i = 0; i < value.Count; i++)
            {
                item = value[i];
                m_itemSerializer.Clone(ref item);
                copy.Add(item);
            }
            value = copy;
        }
        public override void Clone(ref Dictionary <TKey, TValue> obj)
        {
            TKey   key;
            TValue value;
            var    clone = new Dictionary <TKey, TValue>(obj.Count);

            foreach (var pair in obj)
            {
                key   = pair.Key;
                value = pair.Value;
                m_keySerializer.Clone(ref key);
                m_valueSerializer.Clone(ref value);
                clone.Add(key, value);
            }
            obj = clone;
        }