예제 #1
0
        public override void CacheRenderingRegion(ISvgRenderer renderer)
        {
            SvgTransformableElement refEl = ReferencedElement as SvgTransformableElement;

            if (refEl == null)
            {
                return;
            }

            if (renderingNode == null)
            {
                renderingNode = renderer.GetRenderingNode(this);
            }

            // Check if it has already been calculated
            if (renderingNode != null && renderingNode.ScreenRegion != RectangleF.Empty)
            {
                return;
            }

            XmlElement refElParent = (XmlElement)refEl.ParentNode;

            OwnerDocument.Static = true;
            CopyToReferencedElement(refEl);
            refElParent.RemoveChild(refEl);
            this.AppendChild(refEl);
            refEl.CacheRenderingRegion(renderer);
            renderingNode.ScreenRegion = refEl.RenderingNode.ScreenRegion;
            this.RemoveChild(refEl);
            RestoreReferencedElement(refEl);
            refElParent.AppendChild(refEl);
            OwnerDocument.Static = false;
        }
예제 #2
0
 public virtual void Render(ISvgRenderer renderer)
 {
     if (!(this is ISharpDoNotPaint) || (this is SvgSymbolElement && this.ParentNode is SvgUseElement))
     {
         if (renderingNode == null)
         {
             renderingNode = renderer.GetRenderingNode(this);
         }
         if (renderingNode != null)
         {
             if (!renderingNode.NeedRender(renderer))
             {
                 return;
             }
             renderingNode.BeforeRender(renderer);
             renderingNode.Render(renderer);
             RenderChildren(renderer);
             renderingNode.AfterRender(renderer);
         }
     }
 }
예제 #3
0
        public virtual void CacheRenderingRegion(ISvgRenderer renderer)
        {
            if (renderingNode == null)
            {
                renderingNode = renderer.GetRenderingNode(this);
            }

            // Check if it has already been calculated
            if (renderingNode != null && renderingNode.ScreenRegion != RectangleF.Empty)
            {
                return;
            }

            // Invalidate the children
            foreach (XmlNode node in ChildNodes)
            {
                SvgElement element = node as SvgElement;
                if (element != null)
                {
                    element.CacheRenderingRegion(renderer);
                }
            }
        }
예제 #4
0
 public virtual void Render(ISvgRenderer renderer)
 {
     if ( !(this is ISharpDoNotPaint) || (this is SvgSymbolElement && this.ParentNode is SvgUseElement))
       {
     if (renderingNode == null)
     {
       renderingNode = renderer.GetRenderingNode(this);
     }
     if (renderingNode !=  null)
     {
       if (!renderingNode.NeedRender(renderer)) return;
       renderingNode.BeforeRender(renderer);
       renderingNode.Render(renderer);
       RenderChildren(renderer);
       renderingNode.AfterRender(renderer);
     }
       }
 }
예제 #5
0
        public virtual void CacheRenderingRegion(ISvgRenderer renderer)
        {
            if(renderingNode == null)
              {
            renderingNode = renderer.GetRenderingNode(this);
              }

              // Check if it has already been calculated
              if (renderingNode != null && renderingNode.ScreenRegion != RectangleF.Empty)
            return;

              // Invalidate the children
              foreach (XmlNode node in ChildNodes )
              {
            SvgElement element = node as SvgElement;
            if (element != null)
            {
              element.CacheRenderingRegion(renderer);
            }
              }
        }
예제 #6
0
        public override void CacheRenderingRegion(ISvgRenderer renderer)
        {
            SvgTransformableElement refEl = ReferencedElement as SvgTransformableElement;
              if (refEl == null)
            return;

              if(renderingNode == null)
              {
            renderingNode = renderer.GetRenderingNode(this);
              }

              // Check if it has already been calculated
              if (renderingNode != null && renderingNode.ScreenRegion != RectangleF.Empty)
            return;

              XmlElement refElParent = (XmlElement)refEl.ParentNode;
              OwnerDocument.Static = true;
              CopyToReferencedElement(refEl);
              refElParent.RemoveChild(refEl);
              this.AppendChild(refEl);
              refEl.CacheRenderingRegion(renderer);
              renderingNode.ScreenRegion = refEl.RenderingNode.ScreenRegion;
              this.RemoveChild(refEl);
              RestoreReferencedElement(refEl);
              refElParent.AppendChild(refEl);
              OwnerDocument.Static = false;
        }