void FillBuffer(TextNode element)
        {
            var s = Normalize(element.Data);

            if (!String.IsNullOrEmpty(s) && s != " ")
                FillBuffer(new Run(s));
        }
Ejemplo n.º 2
0
 public override Node CloneNode(Boolean deep = true)
 {
     var node = new TextNode(Data);
     CopyProperties(this, node, deep);
     return node;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Appends the given characters to the node.
        /// </summary>
        /// <param name="s">The characters to append.</param>
        /// <returns>The node which contains the text.</returns>
        internal Node AppendText(String s)
        {
            var lastChild = LastChild as TextNode;

            if (lastChild != null)
                return lastChild.AppendData(s);

            var element = new TextNode(s);
            return AppendChild(element);
        }
Ejemplo n.º 4
0
        static TreeNodeViewModel Create(TextNode text)
        {
            if(String.IsNullOrEmpty(text.Data))
                return null;

            var data = text.Data.Split(ws, StringSplitOptions.RemoveEmptyEntries);

            if (data.Length == 0)
                return null;

            return new TreeNodeViewModel { Value = String.Join(" ", data), Foreground = Brushes.SteelBlue };
        }