Exemplo n.º 1
0
        public void ReadFrom(BinaryReader reader)
        {
            _item.ShItemIDs = new List <ShItemID>();
            short idListSize = 0;

            if (_useIDListSize)
            {
                idListSize = reader.ReadInt16();
            }

            if (_useIDListSize && idListSize <= 0)
            {
                return;
            }

            do
            {
                var shitem       = new ShItemID();
                var shitemReader = new ShItemIdHandler(shitem);
                shitemReader.ReadFrom(reader);
                if (shitem.Data != null)
                {
                    _item.ShItemIDs.Add(shitem);
                }
                else
                {
                    break;
                }
            } while (true);
        }
Exemplo n.º 2
0
        public override void ReadFrom(System.IO.BinaryReader reader)
        {
            base.ReadFrom(reader);
            ReadID(reader);
            Offset = reader.ReadInt32();

            var computedOffset = 0;

            foreach (var shitemid in Context.ShItemIDs)
            {
                if (computedOffset == Offset)
                {
                    Item.ShItemID = shitemid;
                    break;
                }
                var handler = new ShItemIdHandler(shitemid);
                computedOffset += handler.ComputedSize;
            }
        }