private void RenderElementAs(SvgElement svgElement) { WpfRenderingBase renderingNode = WpfRendering.Create(svgElement); if (renderingNode == null) { return; } if (!renderingNode.NeedRender(_renderer)) { //renderingNode.Dispose(); //renderingNode = null; return; } _rendererMap[svgElement.UniqueId] = renderingNode; renderingNode.BeforeRender(_renderer); renderingNode.Render(_renderer); if (!renderingNode.IsRecursive && svgElement.HasChildNodes) { RenderChildren(svgElement); } renderingNode = _rendererMap[svgElement.UniqueId]; renderingNode.AfterRender(_renderer); _rendererMap.Remove(svgElement.UniqueId); //renderingNode.Dispose(); //renderingNode = null; }
private void RenderElement(ISvgElement svgElement) { bool isNotRenderable = !svgElement.IsRenderable; if (string.Equals(svgElement.LocalName, "a")) { } if (isNotRenderable) { return; } WpfRenderingBase renderingNode = WpfRendering.Create(svgElement); if (renderingNode == null) { return; } if (!renderingNode.NeedRender(_renderer)) { //renderingNode.Dispose(); //renderingNode = null; return; } SvgElement currentElement = (SvgElement)svgElement; if (_rendererMap.ContainsKey(currentElement.UniqueId)) { // Might be circular rendering... // System.Diagnostics.Debug.WriteLine("Circular Object: " + currentElement.LocalName); return; } _rendererMap[currentElement.UniqueId] = renderingNode; renderingNode.BeforeRender(_renderer); renderingNode.Render(_renderer); if (!renderingNode.IsRecursive && svgElement.HasChildNodes) { RenderChildren(svgElement); } renderingNode = _rendererMap[currentElement.UniqueId]; renderingNode.AfterRender(_renderer); _rendererMap.Remove(currentElement.UniqueId); //renderingNode.Dispose(); //renderingNode = null; }
private void RenderElement(ISvgElement svgElement) { bool isNotRenderable = !svgElement.IsRenderable; //bool isNotRenderable = !svgElement.IsRenderable || string.Equals(svgElement.LocalName, "a"); if (string.Equals(svgElement.LocalName, "a")) { } if (isNotRenderable) { return; } WpfRenderingBase renderingNode = WpfRendering.Create(svgElement); if (renderingNode == null) { return; } if (!renderingNode.NeedRender(_renderer)) { renderingNode.Dispose(); renderingNode = null; return; } _rendererMap[svgElement] = renderingNode; renderingNode.BeforeRender(_renderer); renderingNode.Render(_renderer); if (!renderingNode.IsRecursive && svgElement.HasChildNodes) { RenderChildren(svgElement); } renderingNode = _rendererMap[svgElement]; renderingNode.AfterRender(_renderer); _rendererMap.Remove(svgElement); renderingNode.Dispose(); renderingNode = null; }