Exemplo n.º 1
0
        private void SetPositionProperties(ExcelDrawings drawings, XmlNode node)
        {
            XmlNode posNode = node.SelectSingleNode("xdr:from", drawings.NameSpaceManager);

            if (posNode != null)
            {
                From = new ExcelPosition(drawings.NameSpaceManager, posNode, GetPositionSize);
            }
            else
            {
                posNode = node.SelectSingleNode("xdr:pos", drawings.NameSpaceManager);
                if (posNode != null)
                {
                    Position = new ExcelDrawingCoordinate(drawings.NameSpaceManager, posNode, GetPositionSize);
                }
            }
            posNode = node.SelectSingleNode("xdr:to", drawings.NameSpaceManager);
            if (posNode != null)
            {
                To = new ExcelPosition(drawings.NameSpaceManager, posNode, GetPositionSize);
            }
            else
            {
                To      = null;
                posNode = node.SelectSingleNode("xdr:ext", drawings.NameSpaceManager);
                if (posNode != null)
                {
                    Size = new ExcelDrawingSize(drawings.NameSpaceManager, posNode, GetPositionSize);
                }
            }
        }
Exemplo n.º 2
0
        internal ExcelDrawing(ExcelDrawings drawings, XmlNode node, string nameXPath) :
            base(drawings.NameSpaceManager, node)
        {
            _drawings = drawings;
            _topNode  = node;
            _id       = drawings.Worksheet.Workbook._nextDrawingID++;
            XmlNode posNode = node.SelectSingleNode("xdr:from", drawings.NameSpaceManager);

            if (node != null)
            {
                From = new ExcelPosition(drawings.NameSpaceManager, posNode, GetPositionSize);
            }
            posNode = node.SelectSingleNode("xdr:to", drawings.NameSpaceManager);
            if (node != null)
            {
                To = new ExcelPosition(drawings.NameSpaceManager, posNode, GetPositionSize);
            }
            else
            {
                To = null;
            }
            GetPositionSize();
            _nameXPath      = nameXPath;
            SchemaNodeOrder = new string[] { "from", "to", "graphicFrame", "sp", "clientData" };
        }
Exemplo n.º 3
0
        private void SetPositionProperties(ExcelDrawings drawings, XmlNode node)
        {
            if (_parent == null) //Top level drawing
            {
                XmlNode posNode = node.SelectSingleNode("xdr:from", drawings.NameSpaceManager);
                if (posNode != null)
                {
                    From = new ExcelPosition(drawings.NameSpaceManager, posNode, GetPositionSize);
                }
                else
                {
                    posNode = node.SelectSingleNode("xdr:pos", drawings.NameSpaceManager);
                    if (posNode != null)
                    {
                        Position = new ExcelDrawingCoordinate(drawings.NameSpaceManager, posNode, GetPositionSize);
                    }
                }
                posNode = node.SelectSingleNode("xdr:to", drawings.NameSpaceManager);
                if (posNode != null)
                {
                    To = new ExcelPosition(drawings.NameSpaceManager, posNode, GetPositionSize);
                }
                else
                {
                    To      = null;
                    posNode = node.SelectSingleNode("xdr:ext", drawings.NameSpaceManager);
                    if (posNode != null)
                    {
                        Size = new ExcelDrawingSize(drawings.NameSpaceManager, posNode, GetPositionSize);
                    }
                }
            }
            else //Child to Group shape
            {
                From = null;
                To   = null;
                XmlNode posNode = GetXFrameNode(node, "a:off");
                if (posNode != null)
                {
                    Position = new ExcelDrawingCoordinate(drawings.NameSpaceManager, posNode, GetPositionSize);
                }

                posNode = GetXFrameNode(node, "a:ext");
                if (posNode != null)
                {
                    Size = new ExcelDrawingSize(drawings.NameSpaceManager, posNode, GetPositionSize);
                }
            }
        }