Beispiel #1
0
        /// <summary> Initializes the member variables from the Escher stream data</summary>
        private void  initialize()
        {
            EscherRecordData er = new EscherRecordData(this, 0);

            Assert.verify(er.isContainer());

            escherData = new EscherContainer(er);

            readSpContainer = null;
            if (escherData.Type == EscherRecordType.DG_CONTAINER)
            {
                EscherRecordData erd = new EscherRecordData(this, 80);
                Assert.verify(erd.Type == EscherRecordType.SP_CONTAINER);
                readSpContainer = new SpContainer(erd);
            }
            else
            {
                Assert.verify(escherData.Type == EscherRecordType.SP_CONTAINER);
                readSpContainer = new SpContainer(er);
            }

            Sp sp = (Sp)readSpContainer.Children[0];

            objectId = sp.ShapeId - 1024;

            Opt opt = (Opt)readSpContainer.Children[1];

            if (opt.getProperty(260) != null)
            {
                blipId = opt.getProperty(260).Value;
            }

            if (opt.getProperty(261) != null)
            {
                imageFile = new System.IO.FileInfo(opt.getProperty(261).stringValue);
            }
            else
            {
                logger.warn("no filename property for drawing");
                imageFile = new System.IO.FileInfo(System.Convert.ToString(blipId));
            }

            ClientAnchor clientAnchor = (ClientAnchor)readSpContainer.Children[2];

            x      = clientAnchor.X1;
            y      = clientAnchor.Y1;
            width  = clientAnchor.X2 - x;
            height = clientAnchor.Y2 - y;

            initialized = true;
        }
Beispiel #2
0
        private void  initialize()
        {
            int curpos = Pos + HEADER_LENGTH;
            int endpos = Pos + Length;

            EscherRecord newRecord = null;

            while (curpos < endpos)
            {
                EscherRecordData erd = new EscherRecordData(EscherStream, curpos);

                EscherRecordType type = erd.Type;
                if (type == EscherRecordType.DGG)
                {
                    newRecord = new Dgg(erd);
                }
                else if (type == EscherRecordType.DG)
                {
                    newRecord = new Dg(erd);
                }
                else if (type == EscherRecordType.BSTORE_CONTAINER)
                {
                    newRecord = new BStoreContainer(erd);
                }
                else if (type == EscherRecordType.SPGR_CONTAINER)
                {
                    newRecord = new SpgrContainer(erd);
                }
                else if (type == EscherRecordType.SP_CONTAINER)
                {
                    newRecord = new SpContainer(erd);
                }
                else if (type == EscherRecordType.SPGR)
                {
                    newRecord = new Spgr(erd);
                }
                else if (type == EscherRecordType.SP)
                {
                    newRecord = new Sp(erd);
                }
                else if (type == EscherRecordType.CLIENT_ANCHOR)
                {
                    newRecord = new ClientAnchor(erd);
                }
                else if (type == EscherRecordType.CLIENT_DATA)
                {
                    newRecord = new ClientData(erd);
                }
                else if (type == EscherRecordType.BSE)
                {
                    newRecord = new BlipStoreEntry(erd);
                }
                else if (type == EscherRecordType.OPT)
                {
                    newRecord = new Opt(erd);
                }
                else if (type == EscherRecordType.SPLIT_MENU_COLORS)
                {
                    newRecord = new SplitMenuColors(erd);
                }
                else
                {
                    newRecord = new EscherAtom(erd);
                }

                children.Add(newRecord);
                curpos += newRecord.Length;
            }

            initialized = true;
        }