コード例 #1
0
 /// <summary>
 /// Write the header of this chunk.
 /// Always call the base method first.
 /// </summary>
 protected override void WriteHeader(ResWriter writer)
 {
     headerStartPosition = writer.Position;
     base.WriteHeader(writer);
     writer.WriteInt32(id);
     writer.WriteFixedLenghtUnicodeString(name, 128);
     typeStringsMark = writer.MarkInt32();
     writer.WriteInt32(typeStrings.Count);
     keyStringsMark = writer.MarkInt32();
     writer.WriteInt32(KeyStrings.Count);
 }
コード例 #2
0
ファイル: StringPool.cs プロジェクト: yuva2achieve/dot42
        /// <summary>
        /// Write the header of this chunk.
        /// Always call the base method first.
        /// </summary>
        protected override void WriteHeader(ResWriter writer)
        {
            base.WriteHeader(writer); // header
            writer.WriteInt32(Count); // stringCount
            writer.WriteInt32(0);     // styleCount
            var flags = (StringPoolFlags)0;

            if (IsUtf8)
            {
                flags |= StringPoolFlags.UTF8_FLAG;
            }
            writer.WriteInt32((int)flags);     // flags
            writer.WriteInt32(28 + Count * 4); // stringsStart
            writer.WriteInt32(0);              // stylesStart
        }
コード例 #3
0
 /// <summary>
 /// Write the header of this chunk.
 /// Always call the base method first.
 /// </summary>
 protected sealed override void WriteHeader(ResWriter writer)
 {
     base.WriteHeader(writer);
     writer.WriteInt32(LineNumber);
     StringPoolRef.Write(writer, tree.StringPool, Comment);
     // Extended data (in derived types) is not part of the header
 }
コード例 #4
0
        /// <summary>
        /// Write this chunk.
        /// </summary>
        public void Write(ResWriter writer)
        {
            // Prepare
            PrepareForWrite();

            // First pass
            var position = writer.Stream.Position;

            WriteHeader(writer);
            headerSize = (int)(writer.Stream.Position - position);
            WriteData(writer);
            var endPosition = writer.Stream.Position;

            size = (int)(endPosition - position);

            if ((size & 0x03) != 0)
            {
            }

            // Update header
            writer.Stream.Position = position + 2;
            writer.WriteUInt16(headerSize);
            writer.WriteInt32(size);
            writer.Stream.Position = endPosition;
        }
コード例 #5
0
 /// <summary>
 /// Write the header of this chunk.
 /// Always call the base method first.
 /// </summary>
 protected override void WriteHeader(ResWriter writer)
 {
     base.WriteHeader(writer);
     writer.WriteByte(id);
     writer.WriteByte(0);              // res0
     writer.WriteUInt16(0);            // res1
     writer.WriteInt32(entries.Count); // entryCount
 }
コード例 #6
0
        /// <summary>
        /// Write this chunk.
        /// </summary>
        public void Write(ResWriter writer)
        {
            var size = 8;

            writer.WriteUInt16(size);
            writer.Fill(1); // res0
            writer.WriteByte((int)type);
            writer.WriteInt32(data);
        }
コード例 #7
0
            /// <summary>
            /// Write the header of this chunk.
            /// Always call the base method first.
            /// </summary>
            protected override void WriteHeader(ResWriter writer)
            {
                var startPosition = writer.Position;

                base.WriteHeader(writer);
                writer.WriteByte(parent.Id);
                writer.WriteByte(0);                       // res0
                writer.WriteUInt16(0);                     // res1
                writer.WriteInt32(parent.EntryCount);      // entryCount
                var entriesStartMark = writer.MarkInt32(); // entriesStart

                configuration.Write(writer);

                // Patch entriesStart
                entriesStartMark.Value = (writer.Position - startPosition) + (parent.EntryCount * 4);
            }
コード例 #8
0
 /// <summary>
 /// Save to given writer
 /// </summary>
 internal void Write(ResWriter writer)
 {
     writer.WriteInt32(data.Length + 4);
     writer.WriteByteArray(data);
 }
コード例 #9
0
 /// <summary>
 /// Write the header of this chunk.
 /// Always call the base method first.
 /// </summary>
 protected override void WriteHeader(ResWriter writer)
 {
     base.WriteHeader(writer);
     writer.WriteInt32(packages.Count); // packageCount
 }
コード例 #10
0
 /// <summary>
 /// Write the header of this chunk.
 /// Always call the base method first.
 /// </summary>
 protected virtual void WriteHeader(ResWriter writer)
 {
     writer.WriteUInt16((int)type);
     writer.WriteUInt16(0); // Header size will be updated later
     writer.WriteInt32(0);  // Size will be updated later
 }