Beispiel #1
0
        public static int Write(PropertyData property, AssetReader asset, BinaryWriter writer, bool includeHeader) // Returns location of the length
        {
            writer.Write((int)asset.SearchHeaderReference(property.Name));
            writer.Write(property.WidgetData);
            writer.Write((long)asset.SearchHeaderReference(property.Type));
            int oldLoc = (int)writer.BaseStream.Position;

            writer.Write((long)0); // initial length
            int realLength = property.Write(writer, includeHeader);
            int newLoc     = (int)writer.BaseStream.Position;

            writer.Seek(oldLoc, SeekOrigin.Begin);
            writer.Write((long)realLength);
            writer.Seek(newLoc, SeekOrigin.Begin);
            return(oldLoc);
        }