Пример #1
0
        public void Code(Type t, ref ICountableDict dict)
        {
            long count = CodeCountLong(ref dict, v => v.LongCount);

            if (count < 1L)
            {
                return;
            }
            var keyType   = dict.KeyType;
            var valueType = dict.ValueType;

            foreach (var pair in dict.ObjectPairs)
            {
                var key = pair.E0;
                TypeCoder.Write(this, keyType, ref key);
                var val = pair.E1;
                TypeCoder.Write(this, valueType, ref val);
            }
        }
Пример #2
0
        public void Code(Type t, ref ICountableDict dict)
        {
            int count = CodeCount(ref dict,
                                  n => (ICountableDict)Activator.CreateInstance(t, n));

            if (count < 1)
            {
                return;
            }

            var keyType   = dict.KeyType;
            var valueType = dict.ValueType;

            while (count-- > 0)
            {
                object key = null;
                TypeCoder.Read(this, keyType, ref key);
                object val = null;
                TypeCoder.Read(this, valueType, ref val);
                dict.AddObject(key, val);
            }
        }
Пример #3
0
 public void Code(Type t, ref ICountableDict dict)
 {
     throw new NotImplementedException();
 }