예제 #1
0
        public ChartSheetAggregate(RecordStream rs, ChartRecordAggregate container)
            : base(RuleName_CHARTSHEET, container)
        {
            _bofRec = (BOFRecord)rs.GetNext();
            List <RecordBase> temp = new List <RecordBase>();

            while (rs.PeekNextClass() != typeof(EOFRecord))
            {
                Type a = rs.PeekNextClass();
                if (PageSettingsBlock.IsComponentRecord(rs.PeekNextChartSid()))
                {
                    if (_psBlock != null)
                    {
                        if (rs.PeekNextChartSid() == HeaderFooterRecord.sid)
                        {
                            // test samples: 45538_classic_Footer.xls, 45538_classic_Header.xls
                            _psBlock.AddLateHeaderFooter((HeaderFooterRecord)rs.GetNext());
                            continue;
                        }
                        throw new InvalidDataException(
                                  "Found more than one PageSettingsBlock in chart sub-stream");
                    }
                    _psBlock = new PageSettingsBlock(rs);
                    temp.Add(_psBlock);
                    continue;
                }
                if (rs.PeekNextChartSid() == ChartRecord.sid)
                {
                    chartFormats = new ChartFormatsAggregate(rs, this);
                    temp.Add(chartFormats);
                    continue;
                }
                if (rs.PeekNextChartSid() == DimensionsRecord.sid)
                {
                    seriesData = new SeriesDataAggregate(rs);
                    temp.Add(seriesData);
                    continue;
                }
                temp.Add(rs.GetNext());
            }
            _recs = temp;
            Record eof = rs.GetNext(); // no need to save EOF in field

            if (!(eof is EOFRecord))
            {
                throw new InvalidOperationException("Bad chart EOF");
            }
        }
예제 #2
0
            public ChartFormatsAttachedLabelAggregate(RecordStream rs, ChartRecordAggregate container)
                : base("ChartFormatsAttachedLabel", container)
            {
                if (rs.PeekNextChartSid() == DataLabExtRecord.sid)
                {
                    dataLabExt  = (DataLabExtRecord)rs.GetNext();
                    startObject = (ChartStartObjectRecord)rs.GetNext();
                }

                attachedLabel = new AttachedLabelAggregate(rs, this);

                if (startObject != null)
                {
                    endObject = (ChartEndObjectRecord)rs.GetNext();
                }
            }
예제 #3
0
        public DFTTextAggregate(RecordStream rs, ChartRecordAggregate container)
            : base(RuleName_DFTTEXT, container)
        {
            if (rs.PeekNextChartSid() == DataLabExtRecord.sid)
            {
                dataLabExt  = (DataLabExtRecord)rs.GetNext();
                startObject = (ChartStartObjectRecord)rs.GetNext();
            }
            defaultText   = (DefaultTextRecord)rs.GetNext();
            attachedLabel = new AttachedLabelAggregate(rs, this);

            if (startObject != null)
            {
                endObject = (ChartEndObjectRecord)rs.GetNext();
            }
        }
예제 #4
0
 public LegendExceptionAggregate(RecordStream rs, ChartRecordAggregate container)
     : base(RuleName_LEGENDEXCEPTION, container)
 {
     legendException = (LegendExceptionRecord)rs.GetNext();
     if (rs.PeekNextChartSid() == BeginRecord.sid)
     {
         rs.GetNext();
         attachedLabel = new AttachedLabelAggregate(rs, this);
         if (rs.PeekNextChartSid() == TextPropsStreamRecord.sid ||
             rs.PeekNextChartSid() == RichTextStreamRecord.sid)
         {
             textProps = new TextPropsAggregate(rs, this);
         }
         Record r = rs.GetNext();//EndRecord
         Debug.Assert(r.GetType() == typeof(EndRecord));
     }
 }
예제 #5
0
        public AxesAggregate(RecordStream rs, ChartRecordAggregate container)
            : base(RuleName_AXES, container)
        {
            if (rs.PeekNextChartSid() == AxisRecord.sid)
            {
                AxisRecord axis = (AxisRecord)rs.GetNext();
                rs.GetNext();
                int sid = rs.PeekNextChartSid();
                if (sid == CatSerRangeRecord.sid)
                {
                    ivaxis = new IVAxisAggregate(rs, this, axis);
                }
                else if (sid == ValueRangeRecord.sid)
                {
                    dvaxis = new DVAxisAggregate(rs, this, axis);
                }
                else
                {
                    throw new InvalidOperationException(string.Format("Invalid record sid=0x{0:X}. Shoud be CatSerRangeRecord or ValueRangeRecord", sid));
                }

                Debug.Assert(rs.PeekNextChartSid() == AxisRecord.sid);
                dvaxisSecond = new DVAxisAggregate(rs, this, null);
                if (rs.PeekNextChartSid() == AxisRecord.sid)
                {
                    seriesAxis = new SeriesAxisAggregate(rs, this);
                }

                while (rs.PeekNextChartSid() == TextRecord.sid)
                {
                    attachedLabelList.Add(new AttachedLabelAggregate(rs, this));
                }
                if (rs.PeekNextChartSid() == PlotAreaRecord.sid)
                {
                    plotArea = (PlotAreaRecord)rs.GetNext();
                    if (rs.PeekNextChartSid() == FrameRecord.sid)
                    {
                        frame = new FrameAggregate(rs, this);
                    }
                }
            }
        }
예제 #6
0
        public TextPropsAggregate(RecordStream rs, ChartRecordAggregate container)
            : base(RuleName_TEXTPROPS, container)
        {
            if (rs.PeekNextChartSid() == TextPropsStreamRecord.sid)
            {
                textPropsStream = (TextPropsStreamRecord)rs.GetNext();
            }
            else
            {
                richTextStream = (RichTextStreamRecord)rs.GetNext();
            }

            if (rs.PeekNextChartSid() == ContinueFrt12Record.sid)
            {
                while (rs.PeekNextChartSid() == ContinueFrt12Record.sid)
                {
                    continues.Add((ContinueFrt12Record)rs.GetNext());
                }
            }
        }
예제 #7
0
        public FrameAggregate(RecordStream rs, ChartRecordAggregate container)
            : base(RuleName_FRAME, container)
        {
            frame = (FrameRecord)rs.GetNext();
            rs.GetNext();//BeginRecord
            lineFormat = (LineFormatRecord)rs.GetNext();
            areaFormat = (AreaFormatRecord)rs.GetNext();
            if (rs.PeekNextChartSid() == GelFrameRecord.sid)
            {
                gelFrame = new GelFrameAggregate(rs, this);
            }

            if (rs.PeekNextChartSid() == ShapePropsStreamRecord.sid)
            {
                shapeProps = new ShapePropsAggregate(rs, this);
            }

            Record r = rs.GetNext();//EndRecord

            Debug.Assert(r.GetType() == typeof(EndRecord));
        }
예제 #8
0
        public SeriesAxisAggregate(RecordStream rs, ChartRecordAggregate container)
            : base("SERIESAXIS", container)
        {
            axis = (AxisRecord)rs.GetNext();
            rs.GetNext();

            if (rs.PeekNextChartSid() == CatSerRangeRecord.sid)
            {
                catSerRange = (CatSerRangeRecord)rs.GetNext();
            }

            axs = new AXSAggregate(rs, this);
            if (rs.PeekNextChartSid() == CrtMlFrtRecord.sid)
            {
                crtmlfrt = new CrtMlFrtAggregate(rs, this);
            }

            Record r = rs.GetNext();//EndRecord

            Debug.Assert(r.GetType() == typeof(EndRecord));
        }
예제 #9
0
        public FontListAggregate(RecordStream rs, ChartRecordAggregate container)
            : base(RuleName_FONTLIST, container)
        {
            frtFontList = (FrtFontListRecord)rs.GetNext();
            startObject = (ChartStartObjectRecord)rs.GetNext();
            FontRecord f   = null;
            FbiRecord  fbi = null;

            while (rs.PeekNextChartSid() == FontRecord.sid)
            {
                f = (FontRecord)rs.GetNext();
                if (rs.PeekNextChartSid() == FbiRecord.sid)
                {
                    fbi = (FbiRecord)rs.GetNext();
                }
                else
                {
                    fbi = null;
                }
                dicFonts.Add(f, fbi);
            }

            endObject = (ChartEndObjectRecord)rs.GetNext();
        }
예제 #10
0
        public ChartFormatsAggregate(RecordStream rs, ChartRecordAggregate container)
            : base(RuleName_CHARTFOMATS, container)
        {
            Debug.Assert(rs.PeekNextChartSid() == ChartRecord.sid);
            chart = (ChartRecord)rs.GetNext();
            rs.GetNext();
            while (rs.PeekNextChartSid() == FrtFontListRecord.sid)
            {
                fontList.Add(new FontListAggregate(rs, this));
            }
            Debug.Assert(rs.PeekNextChartSid() == SCLRecord.sid);
            scl        = (SCLRecord)rs.GetNext();
            plotGrowth = (PlotGrowthRecord)rs.GetNext();

            if (rs.PeekNextChartSid() == FrameRecord.sid)
            {
                frame = new FrameAggregate(rs, this);
            }

            while (rs.PeekNextChartSid() == SeriesRecord.sid)
            {
                seriesFormatList.Add(new SeriesFormatAggregate(rs, this));
            }

            while (rs.PeekNextChartSid() == DataFormatRecord.sid)
            {
                ssList.Add(new SSAggregate(rs, this));
            }

            Debug.Assert(rs.PeekNextChartSid() == ShtPropsRecord.sid);
            shtProps = (ShtPropsRecord)rs.GetNext();

            while (rs.PeekNextChartSid() == DefaultTextRecord.sid ||
                   rs.PeekNextChartSid() == DataLabExtRecord.sid)
            {
                dftTextList.Add(new DFTTextAggregate(rs, this));
            }

            Debug.Assert(rs.PeekNextChartSid() == AxesUsedRecord.sid);
            axesUsed = (AxesUsedRecord)rs.GetNext();

            Debug.Assert(rs.PeekNextChartSid() == AxisParentRecord.sid);
            axisParent1 = new AxisParentAggregate(rs, this);
            if (rs.PeekNextChartSid() == AxisParentRecord.sid)
            {
                axisParent2 = new AxisParentAggregate(rs, this);
            }

            if (rs.PeekNextChartSid() == CrtLayout12ARecord.sid)
            {
                crt12A = (CrtLayout12ARecord)rs.GetNext();
            }
            if (rs.PeekNextChartSid() == DatRecord.sid)
            {
                dat = new DatAggregate(rs, container);
            }

            if (rs.PeekNextChartSid() == TextRecord.sid)
            {
                while (rs.PeekNextChartSid() == TextRecord.sid)
                {
                    attachedLabelList.Add(new AttachedLabelAggregate(rs, this));
                }
            }

            if (rs.PeekNextChartSid() == CrtMlFrtRecord.sid)
            {
                crtMlFrt = new CrtMlFrtAggregate(rs, container);
            }

            while (rs.PeekNextChartSid() == DataLabExtRecord.sid || rs.PeekNextChartSid() == TextRecord.sid)
            {
                cfalList.Add(new ChartFormatsAttachedLabelAggregate(rs, this));
            }

            if (rs.PeekNextChartSid() == TextPropsStreamRecord.sid)
            {
                textProps = new TextPropsAggregate(rs, container);
            }

            while (rs.PeekNextChartSid() == CrtMlFrtRecord.sid)
            {
                mlfrtList.Add(new CrtMlFrtAggregate(rs, container));
            }

            Record r = rs.GetNext();//EndRecord

            Debug.Assert(r.GetType() == typeof(EndRecord));
        }
예제 #11
0
 protected ChartRecordAggregate(string ruleName, ChartRecordAggregate container)
 {
     this.RuleName  = ruleName;
     this.Container = container;
 }