Exemplo n.º 1
0
        public static string GetText(string text, RawlerBase rawler, RawlerBase parent)
        {
            Document doc = new Document();

            doc.SetText(text);
            if (parent != null)
            {
                doc.SetParent(parent);
            }
            rawler.SetParent(doc);
            rawler.SetParent();
            var last = rawler.GetDescendantRawler().Last();

            rawler.Run();
            return(last.Text);
        }
Exemplo n.º 2
0
        /// <summary>
        /// クローンを作る
        /// </summary>
        /// <param name="parent"></param>
        /// <returns></returns>
        public virtual RawlerBase Clone(RawlerBase parent)
        {
            RawlerBase clone = new RawlerBase();

            //       RawlerLib.ObjectLib.FildCopy(this, clone);
            clone.SetParent(parent);
            CloneEvent(clone);
            clone.Children.Clear();
            foreach (var item in this.Children)
            {
                var child = item.Clone(clone);
                clone.AddChildren(child);
            }
            return(clone);
        }
Exemplo n.º 3
0
 /// <summary>
 /// PreTreeを通したあとのText
 /// </summary>
 /// <returns></returns>
 protected string GetText()
 {
     if (this.Parent != null)
     {
         if (preTree != null)
         {
             preTree.SetParent();
             return(RawlerBase.GetText(this.Parent.Text, PreTree, this.Parent));
         }
         else
         {
             return(this.Parent.Text);
         }
     }
     else
     {
         return(this.text);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// 最初に挿入する。
 /// </summary>
 /// <param name="rawler"></param>
 public void AddFirst(RawlerBase rawler)
 {
     children.Insert(0, rawler);
     rawler.SetParent(this);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 子を追加する。
 /// </summary>
 /// <param name="rawler"></param>
 public void AddChildren(RawlerBase rawler)
 {
     children.Add(rawler);
     rawler.SetParent(this);
 }