예제 #1
0
        internal override void AfterInsert(HSSFPatriarch patriarch)
        {
            EscherAggregate agg = patriarch.GetBoundAggregate();

            agg.AssociateShapeToObjRecord(GetEscherContainer().GetChildById(EscherClientDataRecord.RECORD_ID), GetObjRecord());
            if (GetTextObjectRecord() != null)
            {
                agg.AssociateShapeToObjRecord(GetEscherContainer().GetChildById(EscherTextboxRecord.RECORD_ID), GetTextObjectRecord());
            }
        }
예제 #2
0
        internal override void AfterInsert(HSSFPatriarch patriarch)
        {
            EscherAggregate       agg             = patriarch.GetBoundAggregate();
            EscherContainerRecord containerRecord = (EscherContainerRecord)GetEscherContainer().GetChildById(EscherContainerRecord.SP_CONTAINER);

            agg.AssociateShapeToObjRecord(containerRecord.GetChildById(EscherClientDataRecord.RECORD_ID), GetObjRecord());
        }
예제 #3
0
        public void TestSerialize()
        {
            EscherContainerRecord  container1   = new EscherContainerRecord();
            EscherContainerRecord  spContainer1 = new EscherContainerRecord();
            EscherContainerRecord  spContainer2 = new EscherContainerRecord();
            EscherContainerRecord  spContainer3 = new EscherContainerRecord();
            EscherSpRecord         sp1          = new EscherSpRecord();
            EscherSpRecord         sp2          = new EscherSpRecord();
            EscherSpRecord         sp3          = new EscherSpRecord();
            EscherClientDataRecord d2           = new EscherClientDataRecord();
            EscherClientDataRecord d3           = new EscherClientDataRecord();

            container1.Options    = ((short)0x000F);
            spContainer1.Options  = ((short)0x000F);
            spContainer1.RecordId = (EscherContainerRecord.SP_CONTAINER);
            spContainer2.Options  = ((short)0x000F);
            spContainer2.RecordId = (EscherContainerRecord.SP_CONTAINER);
            spContainer3.Options  = ((short)0x000F);
            spContainer3.RecordId = (EscherContainerRecord.SP_CONTAINER);
            d2.RecordId           = (EscherClientDataRecord.RECORD_ID);
            d2.RemainingData      = (new byte[0]);
            d3.RecordId           = (EscherClientDataRecord.RECORD_ID);
            d3.RemainingData      = (new byte[0]);
            container1.AddChildRecord(spContainer1);
            container1.AddChildRecord(spContainer2);
            container1.AddChildRecord(spContainer3);
            spContainer1.AddChildRecord(sp1);
            spContainer2.AddChildRecord(sp2);
            spContainer3.AddChildRecord(sp3);
            spContainer2.AddChildRecord(d2);
            spContainer3.AddChildRecord(d3);

            EscherAggregate aggregate = new EscherAggregate(false);

            aggregate.AddEscherRecord(container1);
            aggregate.AssociateShapeToObjRecord(d2, new ObjRecord());
            aggregate.AssociateShapeToObjRecord(d3, new ObjRecord());

            byte[] data         = new byte[112];
            int    bytesWritten = aggregate.Serialize(0, data);

            Assert.AreEqual(112, bytesWritten);
            Assert.AreEqual("[EC, 00, 40, 00, 0F, 00, 00, 00, 58, 00, 00, 00, 0F, 00, 04, F0, 10, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 0F, 00, 04, F0, 18, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 11, F0, 00, 00, 00, 00, 5D, 00, 00, 00, EC, 00, 20, 00, 0F, 00, 04, F0, 18, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 11, F0, 00, 00, 00, 00, 5D, 00, 00, 00]",
                            HexDump.ToHex(data));
        }
예제 #4
0
        internal override void AfterInsert(HSSFPatriarch patriarch)
        {
            EscherAggregate agg = patriarch.GetBoundAggregate();

            agg.AssociateShapeToObjRecord(GetEscherContainer().GetChildById(EscherClientDataRecord.RECORD_ID), GetObjRecord());
            EscherBSERecord bse =
                (patriarch.Sheet.Workbook as HSSFWorkbook).Workbook.GetBSERecord(PictureIndex);

            bse.Ref = (bse.Ref + 1);
        }