Exemplo n.º 1
0
        /// <summary>
        /// 获取克隆对象
        /// </summary>
        /// <returns>克隆对象</returns>
        protected override SVGElement GetCloneObject()
        {
            Tspan result = new Tspan(this.SVG, this.Parent, this.Element);

            result.Node = this.Node;

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 读取节点
        /// </summary>
        /// <param name="node">节点</param>
        /// <param name="parent">父级元素</param>
        private void Read(XNode node, SVGElement parent)
        {
            if (node.NodeType == XmlNodeType.Text)
            {
                Tspan span = new Tspan(this.SVG, parent, null);
                span.Node = node;

                this.Children.Add(span);
            }
            else if (node.NodeType == XmlNodeType.Element)
            {
                XElement element = node as XElement;

                Tspan span = new Tspan(this.SVG, parent, element);
                span.Node = node;

                this.Children.Add(span);

                foreach (XNode n in element.Nodes())
                {
                    this.Read(n, span);
                }
            }
        }