Exemple #1
0
        public override void Encode()
        {
            MemoryStream stream = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(stream);

            NumStrings = StringList.Count;
            writer.Write(TotalOccurance);
            writer.Write(NumStrings);
            this.ContinuedRecords.Clear();
            Record currentRecord = this;

            foreach (String stringVar in StringList)
            {
                int stringlength = Record.GetStringDataLength(stringVar);
                if (stream.Length + stringlength > Record.MaxContentLength)
                {
                    currentRecord.Data = stream.ToArray();
                    currentRecord.Size = (UInt16)currentRecord.Data.Length;

                    stream = new MemoryStream();
                    writer = new BinaryWriter(stream);

                    CONTINUE continuedRecord = new CONTINUE();
                    this.ContinuedRecords.Add(continuedRecord);
                    currentRecord = continuedRecord;
                }
                Record.WriteString(writer, stringVar, 16);
            }
            currentRecord.Data = stream.ToArray();
            currentRecord.Size = (UInt16)currentRecord.Data.Length;
        }
Exemple #2
0
        public override void Encode()
        {
            MemoryStream memoryStream = new MemoryStream();
            BinaryWriter binaryWriter = new BinaryWriter(memoryStream);

            this.NumStrings = this.StringList.Count;
            binaryWriter.Write(this.TotalOccurance);
            binaryWriter.Write(this.NumStrings);
            this.ContinuedRecords.Clear();
            Record record = this;

            checked
            {
                foreach (string text in this.StringList)
                {
                    int stringDataLength = Record.GetStringDataLength(text);
                    if (memoryStream.Length + unchecked ((long)stringDataLength) > 8224L)
                    {
                        record.Data  = memoryStream.ToArray();
                        record.Size  = (ushort)record.Data.Length;
                        memoryStream = new MemoryStream();
                        binaryWriter = new BinaryWriter(memoryStream);
                        CONTINUE cONTINUE = new CONTINUE();
                        this.ContinuedRecords.Add(cONTINUE);
                        record = cONTINUE;
                    }
                    Record.WriteString(binaryWriter, text, 16);
                }
                record.Data = memoryStream.ToArray();
                record.Size = (ushort)record.Data.Length;
            }
        }
Exemple #3
0
        public override void Encode()
        {
            MemoryStream memoryStream = new MemoryStream();
            BinaryWriter writer       = new BinaryWriter(memoryStream);

            Record.WriteString(writer, this.Value, 16);
            this.Data = memoryStream.ToArray();
            this.Size = checked ((ushort)this.Data.Length);
            base.Encode();
        }
Exemple #4
0
        public override void Encode()
        {
            MemoryStream stream = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(stream);

            Record.WriteString(writer, Value, 16);
            this.Data = stream.ToArray();
            this.Size = (UInt16)Data.Length;
            base.Encode();
        }
Exemple #5
0
        public override void Encode()
        {
            MemoryStream memoryStream = new MemoryStream();
            BinaryWriter binaryWriter = new BinaryWriter(memoryStream);

            binaryWriter.Write(this.FormatIndex);
            Record.WriteString(binaryWriter, this.FormatString, 16);
            this.Data = memoryStream.ToArray();
            this.Size = checked ((ushort)this.Data.Length);
            base.Encode();
        }
Exemple #6
0
        public override void Encode()
        {
            MemoryStream stream = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(stream);

            writer.Write(StreamPosition);
            writer.Write(Visibility);
            writer.Write(SheetType);
            Record.WriteString(writer, SheetName, 8);
            this.Data = stream.ToArray();
            this.Size = (UInt16)Data.Length;
            base.Encode();
        }
Exemple #7
0
        public override void Encode()
        {
            MemoryStream memoryStream = new MemoryStream();
            BinaryWriter binaryWriter = new BinaryWriter(memoryStream);

            binaryWriter.Write(this.StreamPosition);
            binaryWriter.Write(this.Visibility);
            binaryWriter.Write(this.SheetType);
            Record.WriteString(binaryWriter, this.SheetName, 8);
            this.Data = memoryStream.ToArray();
            this.Size = checked ((ushort)this.Data.Length);
            base.Encode();
        }
Exemple #8
0
        public override void Encode()
        {
            MemoryStream memoryStream = new MemoryStream();
            BinaryWriter binaryWriter = new BinaryWriter(memoryStream);

            binaryWriter.Write(this.Height);
            binaryWriter.Write(this.OptionFlags);
            binaryWriter.Write(this.ColorIndex);
            binaryWriter.Write(this.Weight);
            binaryWriter.Write(this.Escapement);
            binaryWriter.Write(this.Underline);
            binaryWriter.Write(this.Family);
            binaryWriter.Write(this.CharacterSet);
            binaryWriter.Write(this.NotUsed);
            Record.WriteString(binaryWriter, this.Name, 8);
            this.Data = memoryStream.ToArray();
            this.Size = checked ((ushort)this.Data.Length);
            base.Encode();
        }
Exemple #9
0
        public override void Encode()
        {
            MemoryStream stream = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(stream);

            writer.Write(Height);
            writer.Write(OptionFlags);
            writer.Write(ColorIndex);
            writer.Write(Weight);
            writer.Write(Escapement);
            writer.Write(Underline);
            writer.Write(Family);
            writer.Write(CharacterSet);
            writer.Write(NotUsed);
            Record.WriteString(writer, Name, 8);
            this.Data = stream.ToArray();
            this.Size = (UInt16)Data.Length;
            base.Encode();
        }