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; }
internal BinXmlTemplateDefinition(byte[] bytes, int chunkOffset, int offset) { DataOffset = BitConverter.ToInt32(bytes, offset + 0x05); int dataoffset = DataOffset + chunkOffset; TemplateId = new Guid(Util.GetSubArray(bytes, (uint)dataoffset + 0x04, 0x10)); DataSize = BitConverter.ToInt32(bytes, dataoffset + 0x14); /*List<BinXmlElement> elementList = new List<BinXmlElement>(); * * while (elementoffset < endoffset) * { * Console.WriteLine(elementoffset); * if ((BinaryXml.TOKEN_TYPE)bytes[offset + 0x01] == BinaryXml.TOKEN_TYPE.BinXmlTokenOpenStartElementTag) * { * BinXmlElementNoAttribute element = new BinXmlElementNoAttribute(bytes, chunkOffset, ref elementoffset); * elementList.Add(element); * } * else * { * BinXmlElementAttribute elementattr = new BinXmlElementAttribute(bytes, chunkOffset, ref elementoffset); * elementList.Add(elementattr); * } * } * * Elements = elementList.ToArray();*/ EOFToken = (BinaryXml.TOKEN_TYPE)bytes[dataoffset + DataSize + 0x18 - 0x01]; }
internal BinXmlElementAttribute(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); int attributeListOffset = offset + HeaderSize + BinXmlName.HeaderSize + (ElementName.NameSize * 0x02); //AttributeList = new BinXmlAttributeList(bytes, chunkOffset, attributeListOffset); ElementEndToken = (BinaryXml.TOKEN_TYPE)bytes[offset + this.DataSize + 0x07 - 0x01]; offset += this.DataSize + 0x07; }
internal BinXmlTemplateInstance(byte[] bytes, int chunkOffset, int offset) { Token = (BinaryXml.TOKEN_TYPE)bytes[offset]; TemplateDefinition = new BinXmlTemplateDefinition(bytes, chunkOffset, offset + 0x01); if (TemplateDefinition.DataOffset + chunkOffset > offset) { TemplateInstanceData = new BinXmlTemplateInstanceData(bytes, chunkOffset, offset + 0x01 + TemplateDefinition.DataSize + 0x21); } else { TemplateInstanceData = new BinXmlTemplateInstanceData(bytes, chunkOffset, offset + 0x0A); } //TemplateInstanceData = new BinXmlTemplateInstanceData(bytes, chunkOffset, offset + 0x01 + TemplateDefinition.DataSize + 0x21); // Figure out what to do here... //TemplateInstanceData = new BinXmlTemplateInstanceData(bytes, chunkOffset, offset + 0x0A); }
internal BinXmlValueText(byte[] bytes, int offset) { ValueToken = (BinaryXml.TOKEN_TYPE)bytes[offset]; ValueType = (BinaryXml.VALUE_TYPE)bytes[offset + 0x01]; ValueData = Encoding.Unicode.GetString(bytes, offset + 0x04, BitConverter.ToInt16(bytes, offset + 0x02)); }
internal BinXmlSubstitution(byte[] bytes, int offset) { Token = (BinaryXml.TOKEN_TYPE)bytes[offset]; SubstitutionId = BitConverter.ToUInt16(bytes, 0x01); ValueType = (BinaryXml.VALUE_TYPE)bytes[0x03]; }
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; }
internal BinXmlElementAttribute(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); int attributeListOffset = offset + HeaderSize + BinXmlName.HeaderSize + (ElementName.NameSize * 0x02); //AttributeList = new BinXmlAttributeList(bytes, chunkOffset, attributeListOffset); ElementEndToken = (BinaryXml.TOKEN_TYPE)bytes[offset + this.DataSize + 0x07 - 0x01]; offset += this.DataSize + 0x07; }
internal BinXmlAttribute(byte[] bytes, int chunkOffset, int offset) { Token = (BinaryXml.TOKEN_TYPE)bytes[offset]; AttributeNameOffset = BitConverter.ToInt32(bytes, offset + 0x01); Name = new BinXmlName(bytes, chunkOffset + AttributeNameOffset); }
internal BinXmlTemplateDefinition(byte[] bytes, int chunkOffset, int offset) { DataOffset = BitConverter.ToInt32(bytes, offset + 0x05); int dataoffset = DataOffset + chunkOffset; TemplateId = new Guid(Util.GetSubArray(bytes, (uint)dataoffset + 0x04, 0x10)); DataSize = BitConverter.ToInt32(bytes, dataoffset + 0x14); /*List<BinXmlElement> elementList = new List<BinXmlElement>(); while (elementoffset < endoffset) { Console.WriteLine(elementoffset); if ((BinaryXml.TOKEN_TYPE)bytes[offset + 0x01] == BinaryXml.TOKEN_TYPE.BinXmlTokenOpenStartElementTag) { BinXmlElementNoAttribute element = new BinXmlElementNoAttribute(bytes, chunkOffset, ref elementoffset); elementList.Add(element); } else { BinXmlElementAttribute elementattr = new BinXmlElementAttribute(bytes, chunkOffset, ref elementoffset); elementList.Add(elementattr); } } Elements = elementList.ToArray();*/ EOFToken = (BinaryXml.TOKEN_TYPE)bytes[dataoffset + DataSize + 0x18 - 0x01]; }
internal BinXmlSubstitution(byte[] bytes, int offset) { Token = (BinaryXml.TOKEN_TYPE)bytes[offset]; SubstitutionId = BitConverter.ToUInt16(bytes, 0x01); ValueType = (BinaryXml.VALUE_TYPE)bytes[0x03]; }
internal BinXmlValueText(byte[] bytes, int offset) { ValueToken = (BinaryXml.TOKEN_TYPE)bytes[offset]; ValueType = (BinaryXml.VALUE_TYPE)bytes[offset + 0x01]; ValueData = Encoding.Unicode.GetString(bytes, offset + 0x04, BitConverter.ToInt16(bytes, offset + 0x02)); }
internal BinXmlAttribute(byte[] bytes, int chunkOffset, int offset) { Token = (BinaryXml.TOKEN_TYPE)bytes[offset]; AttributeNameOffset = BitConverter.ToInt32(bytes, offset + 0x01); Name = new BinXmlName(bytes, chunkOffset + AttributeNameOffset); }
internal BinXmlCharacterEntityReference(byte[] bytes, int offset) { Token = (BinaryXml.TOKEN_TYPE)bytes[offset]; Value = Util.GetSubArray(bytes, (uint)offset + 0x01, 0x02); }
internal BinXmlCharacterEntityReference(byte[] bytes, int offset) { Token = (BinaryXml.TOKEN_TYPE)bytes[offset]; Value = Util.GetSubArray(bytes, (uint)offset + 0x01, 0x02); }
internal BinXmlEntityReference(byte[] bytes, int offset) { Token = (BinaryXml.TOKEN_TYPE)bytes[offset]; NameOffset = BitConverter.ToUInt32(bytes, offset + 0x01); }
internal BinXmlEntityReference(byte[] bytes, int offset) { Token = (BinaryXml.TOKEN_TYPE)bytes[offset]; NameOffset = BitConverter.ToUInt32(bytes, offset + 0x01); }
internal BinXmlTemplateInstance(byte[] bytes, int chunkOffset, int offset) { Token = (BinaryXml.TOKEN_TYPE)bytes[offset]; TemplateDefinition = new BinXmlTemplateDefinition(bytes, chunkOffset, offset + 0x01); if (TemplateDefinition.DataOffset + chunkOffset > offset) { TemplateInstanceData = new BinXmlTemplateInstanceData(bytes, chunkOffset, offset + 0x01 + TemplateDefinition.DataSize + 0x21); } else { TemplateInstanceData = new BinXmlTemplateInstanceData(bytes, chunkOffset, offset + 0x0A); } //TemplateInstanceData = new BinXmlTemplateInstanceData(bytes, chunkOffset, offset + 0x01 + TemplateDefinition.DataSize + 0x21); // Figure out what to do here... //TemplateInstanceData = new BinXmlTemplateInstanceData(bytes, chunkOffset, offset + 0x0A); }
internal BinXmlCDATA(byte[] bytes, int offset) { Token = (BinaryXml.TOKEN_TYPE)bytes[offset]; }