예제 #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;
        }
예제 #2
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();
        }
예제 #3
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();
        }
예제 #4
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();
        }