示例#1
0
        public HeaderFooter(IStreamReader reader, RecordType id, UInt16 length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            this.frtHeader = new FrtHeader(reader);
            this.guidSView = new Guid(reader.ReadBytes(16));
            UInt16 flags = reader.ReadUInt16();

            this.cchHeaderEven  = reader.ReadUInt16();
            this.cchFooterEven  = reader.ReadUInt16();
            this.cchHeaderFirst = reader.ReadUInt16();
            this.cchFooterFirst = reader.ReadUInt16();

            byte[] strHeaderEvenBytes  = reader.ReadBytes(cchHeaderEven);
            byte[] strFooterEvenBytes  = reader.ReadBytes(cchFooterEven);
            byte[] strHeaderFirstBytes = reader.ReadBytes(cchHeaderFirst);
            byte[] strFooterFirstBytes = reader.ReadBytes(cchFooterFirst);

            //this.strHeaderEven = new XLUnicodeString(reader).Value;
            //this.strFooterEven = new XLUnicodeString(reader).Value;
            //this.strHeaderFirst = new XLUnicodeString(reader).Value;
            //this.strFooterFirst = new XLUnicodeString(reader).Value;

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
示例#2
0
        public CrtLayout12(IStreamReader reader, RecordType id, ushort length)
            : base(reader, id, length)
        {
            this.frtHeader  = new FrtHeader(reader);
            this.dwCheckSum = reader.ReadUInt32();
            ushort flags = reader.ReadUInt16();

            this.fLayoutTargetInner = Utils.BitmaskToBool(flags, 0x1);
            this.autolayouttype     = (AutoLayoutType)Utils.BitmaskToInt(flags, 0xE);
            if (id == RecordType.CrtLayout12A)
            {
                this.xTL = reader.ReadInt16();
                this.yTL = reader.ReadInt16();
                this.xBR = reader.ReadInt16();
                this.yBR = reader.ReadInt16();
            }
            this.wXMode      = (CrtLayout12Mode)reader.ReadUInt16();
            this.wYMode      = (CrtLayout12Mode)reader.ReadUInt16();
            this.wWidthMode  = (CrtLayout12Mode)reader.ReadUInt16();
            this.wHeightMode = (CrtLayout12Mode)reader.ReadUInt16();
            this.x           = reader.ReadDouble();
            this.y           = reader.ReadDouble();
            this.dx          = reader.ReadDouble();
            this.dy          = reader.ReadDouble();
            reader.ReadBytes(2); //reserved

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
示例#3
0
        public RichTextStream(IStreamReader reader, RecordType id, UInt16 length)
            : base(reader, id, length)
        {
            this.frtHeader  = new FrtHeader(reader);
            this.dwCheckSum = reader.ReadUInt32();
            this.cb         = reader.ReadUInt32();
            Encoding codepage = Encoding.GetEncoding(1252);

            this.rgb = codepage.GetString(reader.ReadBytes((int)this.cb));
        }
示例#4
0
        public RichTextStream(IStreamReader reader, RecordType id, ushort length)
            : base(reader, id, length)
        {
            this.frtHeader  = new FrtHeader(reader);
            this.dwCheckSum = reader.ReadUInt32();
            this.cb         = reader.ReadUInt32();
            var codepage = Encoding.GetEncoding("ISO-8859-1"); // windows-1252 not supported by platform

            this.rgb = codepage.GetString(reader.ReadBytes((int)this.cb));
        }
示例#5
0
        public DataLabExt(IStreamReader reader, RecordType id, UInt16 length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            this.frtHeader = new FrtHeader(reader);

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
示例#6
0
        public CrtMlFrt(IStreamReader reader, RecordType id, ushort length)
            : base(reader, id, length)
        {
            long pos = reader.BaseStream.Position;

            this.frtHeader  = new FrtHeader(reader);
            this.cb         = reader.ReadUInt32();
            this.xmltkChain = new XmlTkChain(reader);
            reader.ReadBytes(4); // unused

            reader.BaseStream.Position = pos + length;
        }
示例#7
0
        public CrtMlFrtContinue(IStreamReader reader, RecordType id, ushort length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            this.FrtHeader = new FrtHeader(reader);

            this.XmlTkChain = new XmlTkChain(reader);

            //unused
            reader.ReadBytes(4);

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
示例#8
0
        public ShapePropsStream(IStreamReader reader, RecordType id, UInt16 length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            this.frtHeader   = new FrtHeader(reader);
            this.wObjContext = reader.ReadUInt16();
            reader.ReadBytes(2); //unused
            this.dwChecksum = reader.ReadUInt32();
            this.cb         = reader.ReadUInt32();
            this.rgb        = reader.ReadBytes((int)cb);

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
示例#9
0
        public PLV(IStreamReader reader, RecordType id, UInt16 length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            this.frtHeader = new FrtHeader(reader);
            this.wScalePLV = reader.ReadUInt16();

            UInt16 flags = reader.ReadUInt16();

            this.fPageLayoutView   = Utils.BitmaskToBool(flags, 0x0001);
            this.fRulerVisible     = Utils.BitmaskToBool(flags, 0x0002);
            this.fWhitespaceHidden = Utils.BitmaskToBool(flags, 0x0004);

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
示例#10
0
        public TextPropsStream(IStreamReader reader, RecordType id, UInt16 length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            this.frtHeader = new FrtHeader(reader);

            this.dwChecksum = reader.ReadUInt32();
            this.cb         = reader.ReadUInt32();

            byte[]   rgbBytes = reader.ReadBytes((int)this.cb);
            Encoding codepage = Encoding.GetEncoding(1252);

            this.rgb = codepage.GetString(rgbBytes);

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
示例#11
0
        public SheetExt(IStreamReader reader, RecordType id, ushort length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            this.frtHeader = new FrtHeader(reader);
            this.cb        = reader.ReadUInt32();
            this.icvPlain  = reader.ReadUInt32();

            // read optional field if record length is accordingly
            if (this.Length == 40)
            {
                this.sheetExtOptional = new SheetExtOptional(reader);
            }

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
示例#12
0
        public TextPropsStream(IStreamReader reader, RecordType id, ushort length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            this.frtHeader = new FrtHeader(reader);

            this.dwChecksum = reader.ReadUInt32();
            this.cb         = reader.ReadUInt32();

            var rgbBytes = reader.ReadBytes((int)this.cb);
            var codepage = Encoding.GetEncoding("ISO-8859-1"); // windows-1252 not supported by platform

            this.rgb = codepage.GetString(rgbBytes);

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
示例#13
0
        public DataLabExtContents(IStreamReader reader, RecordType id, ushort length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            this.frtHeader = new FrtHeader(reader);

            ushort flags = reader.ReadUInt16();

            this.fSerName  = Utils.BitmaskToBool(flags, 0x0001);
            this.fCatName  = Utils.BitmaskToBool(flags, 0x0002);
            this.fValue    = Utils.BitmaskToBool(flags, 0x0004);
            this.fPercent  = Utils.BitmaskToBool(flags, 0x0008);
            this.fBubSizes = Utils.BitmaskToBool(flags, 0x0010);

            this.rgchSep = new XLUnicodeStringMin2(reader);

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }