Esempio n. 1
0
        public void TestFillFields()
        {
            String hexData = "02 00 " +
                             "11 F0 " +
                             "00 00 00 00 ";

            byte[] data = HexRead.ReadFromString(hexData);
            EscherClientDataRecord r = new EscherClientDataRecord();
            int bytesWritten         = r.FillFields(data, new DefaultEscherRecordFactory());

            Assert.AreEqual(8, bytesWritten);
            Assert.AreEqual(unchecked ((short)0xF011), r.RecordId);
            Assert.AreEqual("[]", HexDump.ToHex(r.RemainingData));
        }
Esempio n. 2
0
 /**
  * Search for EscherClientDataRecord, if found, convert its contents into an array of HSLF records
  *
  * @return an array of HSLF records Contained in the shape's EscherClientDataRecord or <code>null</code>
  */
 protected Record[] GetClientRecords()
 {
     if (_clientData == null)
     {
         EscherRecord r = Shape.GetEscherChild(GetSpContainer(), EscherClientDataRecord.RECORD_ID);
         //ddf can return EscherContainerRecord with recordId=EscherClientDataRecord.RECORD_ID
         //convert in to EscherClientDataRecord on the fly
         if (r != null && !(r is EscherClientDataRecord))
         {
             byte[] data = r.Serialize();
             r = new EscherClientDataRecord();
             r.FillFields(data, 0, new DefaultEscherRecordFactory());
         }
         _clientData = (EscherClientDataRecord)r;
     }
     if (_clientData != null && _clientRecords == null)
     {
         byte[] data = _clientData.GetRemainingData();
         _clientRecords = Record.FindChildRecords(data, 0, data.Length);
     }
     return(_clientRecords);
 }