Ejemplo n.º 1
0
        private void Read(BinaryReader br)
        {
            version = br.ReadInt16();
            var segmentation  = br.ReadInt16();
            var dataSet       = new DataSet();
            var skipValues    = new Dictionary <ElementsList, List <byte[]> >();
            var CurrentConfig = Config.Downgrade(version);

            foreach (var list in CurrentConfig.Lists)
            {
                if (_readLists != null)
                {
                    if (_readLists.All(elementsList => dataSet.Tables.Contains(elementsList.Name)))
                    {
                        break;
                    }
                }

                if (list.Skip != "0")
                {
                    skipValues.Add(list, ReadSkip(br, list));
                }

                var data = ReadList(br, list);

                if (_readLists != null)
                {
                    if (_readLists.All(x => x.Name == list.Name))
                    {
                        dataSet.Tables.Add(data);
                    }
                }
                else
                {
                    dataSet.Tables.Add(data);
                }
            }

            ElementsData = new ElementsData(version, segmentation, dataSet, skipValues, CurrentConfig);
        }
Ejemplo n.º 2
0
 public ElementsWriter(string path, ElementsData elements, Config config)
 {
     Path     = path;
     Elements = elements;
     Config   = config;
 }