Esempio n. 1
0
        internal BinXmlElementNoAttribute(byte[] bytes, int chunkOffset, ref int offset)
        {
            Token             = (BinaryXml.TOKEN_TYPE)bytes[offset];
            DependencyId      = BitConverter.ToInt16(bytes, offset + 0x01);
            DataSize          = BitConverter.ToInt32(bytes, offset + 0x03);
            ElementNameOffset = BitConverter.ToInt32(bytes, offset + 0x07);
            ElementName       = new BinXmlName(bytes, chunkOffset + ElementNameOffset);
            CloseStartTag     = (BinaryXml.TOKEN_TYPE)bytes[offset + HeaderSize + BinXmlName.HeaderSize + (ElementName.NameSize * 0x02)];

            int valueOffset = offset + HeaderSize + BinXmlName.HeaderSize + (ElementName.NameSize * 0x02) + 0x01;

            ValueTag = (BinaryXml.TOKEN_TYPE)bytes[valueOffset];

            if (ValueTag == BinaryXml.TOKEN_TYPE.BinXmlTokenValue)
            {
                ValueText = new BinXmlValueText(bytes, offset);
            }
            else
            {
                Substitution = new BinXmlSubstitution(bytes, valueOffset);
            }

            ElementEndToken = (BinaryXml.TOKEN_TYPE)bytes[offset + this.DataSize + 0x07 - 0x01];

            offset += this.DataSize + 0x07;
        }
Esempio n. 2
0
        internal BinXmlElementNoAttribute(byte[] bytes, int chunkOffset, ref int offset)
        {
            Token = (BinaryXml.TOKEN_TYPE)bytes[offset];
            DependencyId = BitConverter.ToInt16(bytes, offset + 0x01);
            DataSize = BitConverter.ToInt32(bytes, offset + 0x03);
            ElementNameOffset = BitConverter.ToInt32(bytes, offset + 0x07);
            ElementName = new BinXmlName(bytes, chunkOffset + ElementNameOffset);
            CloseStartTag = (BinaryXml.TOKEN_TYPE)bytes[offset + HeaderSize + BinXmlName.HeaderSize + (ElementName.NameSize * 0x02)];

            int valueOffset = offset + HeaderSize + BinXmlName.HeaderSize + (ElementName.NameSize * 0x02) + 0x01;
            ValueTag = (BinaryXml.TOKEN_TYPE)bytes[valueOffset];

            if (ValueTag == BinaryXml.TOKEN_TYPE.BinXmlTokenValue)
            {
                ValueText = new BinXmlValueText(bytes, offset);
            }
            else
            {
                Substitution = new BinXmlSubstitution(bytes, valueOffset);
            }

            ElementEndToken = (BinaryXml.TOKEN_TYPE)bytes[offset + this.DataSize + 0x07 - 0x01];

            offset += this.DataSize + 0x07;
        }