Ejemplo n.º 1
0
        private void CheckFillFieldsSimple()
        {
            string dataStr = "33 00 " +       // options
                             "0B F0 " +       // recordid
                             "12 00 00 00 " + // remaining bytes
                             "BF 00 08 00 08 00 " +
                             "81 01 09 00 00 08 " +
                             "C0 01 40 00 00 08";

            EscherOptRecord r = new EscherOptRecord();

            r.FillFields(HexRead.ReadFromString(dataStr), new DefaultEscherRecordFactory());
            Assert.AreEqual((short)0x0033, r.Options);
            Assert.AreEqual(unchecked ((short)0xF00B), r.RecordId);
            Assert.AreEqual(3, r.EscherProperties.Count);
            EscherBoolProperty prop1 = new EscherBoolProperty(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 524296);
            EscherRGBProperty  prop2 = new EscherRGBProperty(EscherProperties.FILL__FILLCOLOR, 0x08000009);
            EscherRGBProperty  prop3 = new EscherRGBProperty(EscherProperties.LINESTYLE__COLOR, 0x08000040);

            Assert.AreEqual(prop1, r.GetEscherProperty(0));
            Assert.AreEqual(prop2, r.GetEscherProperty(1));
            Assert.AreEqual(prop3, r.GetEscherProperty(2));
        }
Ejemplo n.º 2
0
        private void CheckFillFieldsComplex()
        {
            string dataStr = "33 00 " +
                             "0B F0 " +
                             "14 00 00 00 " +
                             "BF 00 01 00 00 00 " +
                             "01 80 02 00 00 00 " +
                             "BF 00 01 00 00 00 " +
                             "01 02";

            EscherOptRecord r = new EscherOptRecord();

            r.FillFields(HexRead.ReadFromString(dataStr), new DefaultEscherRecordFactory());
            Assert.AreEqual((short)0x0033, r.Options);
            Assert.AreEqual(unchecked ((short)0xF00B), r.RecordId);
            Assert.AreEqual(3, r.EscherProperties.Count);
            EscherBoolProperty    prop1 = new EscherBoolProperty(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 1);
            EscherComplexProperty prop2 = new EscherComplexProperty((short)1, false, new byte[] { 0x01, 0x02 });
            EscherBoolProperty    prop3 = new EscherBoolProperty(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 1);

            Assert.AreEqual(prop1, r.GetEscherProperty(0));
            Assert.AreEqual(prop2, r.GetEscherProperty(1));
            Assert.AreEqual(prop3, r.GetEscherProperty(2));
        }