Ejemplo n.º 1
0
        /// <summary>
        /// このクラスでの実行すること。
        /// </summary>
        /// <param name="runChildren"></param>
        public override void Run(bool runChildren)
        {
            var page = this.GetAncestorRawler().OfType <Page>().FirstOrDefault();

            if (page != null)
            {
                if (tmpUrl == page.GetCurrentUrl())
                {
                    tmpCount++;
                    if (tmpCount >= reloadCount)
                    {
                        ReportManage.ErrReport(this, "ReloadCount:規定数のリロード回数を超えました。");
                        OverCountTree.SetParent(this);
                        OverCountTree.Run();
                        return;
                    }
                }
                else
                {
                    tmpUrl   = page.GetCurrentUrl();
                    tmpCount = 0;
                }
                page.Reload();
                System.Threading.Thread.Sleep((int)(sleepSeconds * 1000));
            }
            base.Run(runChildren);
        }
Ejemplo n.º 2
0
        public static string GetText(string text, RawlerBase rawler)
        {
            Document doc = new Document();

            doc.SetText(text);
            rawler.SetParent(doc);
            var last = rawler.GetDescendantRawler().Last();

            rawler.Run();
            return(last.Text);
        }
Ejemplo n.º 3
0
 public override void Run(bool runChildren)
 {
     try
     {
         RawlerBase rawler = (RawlerBase)System.Xaml.XamlServices.Load(FileName);
         rawler.SetParent(this);
         rawler.Run();
     }
     catch (Exception ex)
     {
         ReportManage.ErrReport(this, ex.ToString());
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// このクラスでの実行すること。
        /// </summary>
        /// <param name="runChildren"></param>
        public override void Run(bool runChildren)
        {
            var data = this.GetAncestorRawler().OfType <Data>().FirstOrDefault();

            if (data != null)
            {
                if (data.GetCurrentDataRow().DataDic.Count >= MinAttributeCount)
                {
                    base.Run(runChildren);
                }
                else
                {
                    if (FailedTree != null)
                    {
                        FailedTree.SetParent(this);
                        FailedTree.Run();
                    }
                }
            }
        }