Example #1
0
        /// <summary>
        /// This writes a MAP file text block.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="text">Text to write in to block</param>
        private void WriteTextBlock(MapTextBlock block)
        {
            var text = block.Value;

            text = Other.ConvertLineBreaksCRLFToLF(text) + "\0";
            //Insure division by 2 of block length
            text = text.PadRight(text.Length + text.Length % 2, '\0');

            _binWriter.Write(Encoding.ASCII.GetBytes(block.Name));
            //For some reason each text block has to have length overlapping with start of next block
            _binWriter.Write((UInt32)(text.Length + 4));
            _binWriter.Write(Encoding.ASCII.GetBytes(text));
        }
Example #2
0
        private void WriteString(string value)
        {
            var newValue = Other.ConvertLineBreaksCRLFToLF(value);

            _binWriter.Write(Encoding.ASCII.GetBytes(newValue));
        }