Exemplo n.º 1
0
        public static void DeserializeList <T>(BinaryTypesReader br, List <T> list, ReadDataDelegate <T> itemReader, object objParam)
        {
            //Clear the list before work starts. In case the list is null it will throw exception
            list.Clear();
            int count = br.Read7BitInt();

            for (int i = 0; i < count; i++)
            {
                T item = itemReader(br, objParam);
                list.Add(item);
            }
        }
Exemplo n.º 2
0
        public static void DeserializeDictionary <K, V>(
            BinaryTypesReader br,
            IDictionary <K, V> map,
            ReadDataDelegate <K> keyReader,
            object keyObjParam,
            ReadDataDelegate <V> valReader,
            object valObjParam)
        {
            int count = br.Read7BitInt();

            for (int i = 0; i < count; i++)
            {
                K key = keyReader(br, keyObjParam);
                V val = valReader(br, valObjParam);
                map.Add(key, val);
            }
        }
 public GenericTypeDefinition(string name, Type dataType, ReadDataDelegate readData)
     : base(name, dataType)
 {
     _readData = readData;
 }
Exemplo n.º 4
0
 public SimpleCollection(BinaryReader br, ReadDataDelegate delg)
 {
     ReadData = delg;
     Read(br);
 }
Exemplo n.º 5
0
 public SimpleCollection(ReadDataDelegate delg)
 {
     ReadData = delg;
 }
Exemplo n.º 6
0
 public SimpleArray(BinaryReader br, int count, ReadDataDelegate delg)
     : this(count, delg)
 {
     Read(br);
 }
Exemplo n.º 7
0
 public SimpleArray(int count, ReadDataDelegate delg)
 {
     Count    = count;
     ReadData = delg;
 }