Exemplo n.º 1
0
        public override void FromJson(JsonTextReader reader)
        {
            DataArray = new PkgDataArray(ParentFile);

            reader.Read();
            reader.Read();
            name = (string)reader.Value;

            reader.Read();
            Elements[0].FromJson(reader);
            Elements[1].ValueOffsetType.Type = 128;
        }
Exemplo n.º 2
0
        public override void Read(PkgBinaryReader reader)
        {
            ValueOffsetType = reader.ReadOffsetType();

            if (ValueOffsetType.Type == 128)
            {
                long pos = reader.BaseStream.Position;
                reader.Seek(ValueOffsetType.Offset, SeekOrigin.Begin);

                string chunkType = reader.ReadString(4);
                switch (chunkType)
                {
                case "!idi":
                    ComplexValueData = new PkgObject(ParentFile);
                    ComplexValueData.Read(reader);
                    break;

                case "!ili":
                    ComplexValueData = new PkgArray(ParentFile);
                    ComplexValueData.Read(reader);
                    break;

                case "!iar":
                    ComplexValueData = new PkgDataArrayReference(ParentFile);
                    ComplexValueData.Read(reader);
                    break;

                case "!vca":
                    ComplexValueData = new PkgDataArray(ParentFile);
                    ComplexValueData.Read(reader);
                    break;

                case "!sbi":
                    ComplexValueData = PkgData.Create(ParentFile, "stri");
                    ComplexValueData.Read(reader);
                    break;

                case "!vbi":
                    ComplexValueData = PkgData.Create(reader, ParentFile);
                    ComplexValueData.Read(reader);
                    break;

                default:
                    throw new Exception("Chunk type not supported! " + chunkType);
                }

                reader.Seek((int)pos, SeekOrigin.Begin);
            }
        }