Ejemplo n.º 1
0
        public void ReadXml(XmlReader reader)
        {
            Name = reader.GetAttribute("name");
            string dataType = reader.GetAttribute("type");

            DataType = ExtensionMethods.ParseFoxDataType(dataType);
            string containerType = reader.GetAttribute("container");

            ContainerType = ExtensionMethods.ParseFoxContainerType(containerType);
            bool emptyElement = reader.IsEmptyElement;

            reader.ReadStartElement("property");
            Container = FoxContainerFactory.CreateTypedContainer(DataType, ContainerType);
            if (emptyElement == false)
            {
                Container.ReadXml(reader);
                reader.ReadEndElement();
            }
        }
Ejemplo n.º 2
0
        private void Read(Stream input)
        {
            BinaryReader reader = new BinaryReader(input, Encoding.Default, true);

            NameHash = reader.ReadUInt64();

            DataType      = (FoxDataType)reader.ReadByte();
            ContainerType = (FoxContainerType)reader.ReadByte();
            short  valueCount = reader.ReadInt16();
            short  offset     = reader.ReadInt16();
            ushort size       = reader.ReadUInt16();

            int unknown2 = reader.ReadInt32();
            int unknown3 = reader.ReadInt32();
            int unknown4 = reader.ReadInt32();
            int unknown5 = reader.ReadInt32();

            Container = FoxContainerFactory.ReadFoxContainer(input, DataType, ContainerType, valueCount);
            input.AlignRead(16);
        }