示例#1
0
        public Element ConvertToLocal(HtmlNode node, CompositeElement <IOutlineChildElement> parent)
        {
            var builder = creator.GetBuilder(node);

            if (builder.GetElement().ElementType == ElementType.PlainText)
            {
                return(null);
            }

            Dictionary <string, string> properties = ReadNodeProperties(node);

            if (builder.GetElement().ElementType == ElementType.TextElement)
            {
                properties.Add("Text", node.InnerText);
            }

            if (parent != null)
            {
                builder.BuildElement(properties, parent);
            }
            else
            {
                builder.BuildElement(properties);
            }

            return(builder.GetElement());
        }
示例#2
0
 public void BuildElement(Dictionary <string, string> properties, CompositeElement <IOutlineChildElement> parent)
 {
     if (parent != null)
     {
         parent.AddChildElement(element as IOutlineChildElement);
         element.ParentElement = parent;
     }
     BuildElement(properties);
 }