//public new void Run() //{ // Run(true); //} /// <summary> /// 実行 /// </summary> /// <param name="runChildren"></param> public override void Run(bool runChildren) { string containsText = this.ContainsText.Convert(this); string text = this.GetText(); if (ContainsTextTree != null) { containsText = RawlerBase.GetText(this.Parent.Text, ContainsTextTree, this); } if (TextTree != null) { text = RawlerBase.GetText(this.Parent.Text, TextTree, this); } if (text.Contains(containsText) == this.Result) { this.RunChildren(runChildren); } //if (ContainsTextTree == null) //{ // if (this.GetText().Contains(this.ContainsText) == this.Result) // { // this.RunChildren(runChildren); // } //} //else //{ // string t = RawlerBase.GetText(this.Parent.Text, ContainsTextTree, this); // if (this.GetText().Contains(t) == this.Result) // { // this.RunChildren(runChildren); // } //} }
protected string GetSwitchValue() { if (SwitchValueTree != null) { SwitchValueTree.SetParent(); return(RawlerBase.GetText(this.Parent.Text, SwitchValueTree, this.Parent)); } else { return(GetText()); } }
/// <summary> /// このクラスでの実行すること。 /// </summary> /// <param name="runChildren"></param> public override void Run(bool runChildren) { if (Text2Tree == null) { ReportManage.ErrReport(this, "Text2Treeが空です。実行にはText2Treeが必要です。"); return; } Text2Tree.SetParent(this); string t = RawlerBase.GetText(this.parent.Text, Text2Tree, this); var result = Compute(GetText(), t); if (result <= maxDistance) { SetText(result.ToString()); base.Run(runChildren); } }
/// <summary> /// このクラスでの実行すること。 /// </summary> /// <param name="runChildren"></param> public override void Run(bool runChildren) { var login = this.GetAncestorRawler().OfType <TwitterLogin>().First(); bool flag = true; Dictionary <string, object> dic = new Dictionary <string, object>(); string track; if (TrackTree != null) { TrackTree.SetParent(this); track = RawlerBase.GetText(GetText(), TrackTree, this); } else { track = Track; } dic.Add("track", track); var stream = login.Token.Streaming.StartObservableStream(StreamingType.Filter, new StreamingParameters(dic)).Publish(); stream.OfType <StatusMessage>() .Subscribe(x => { Document d = new Document() { TextValue = Codeplex.Data.DynamicJson.Serialize(x.Status) }; d.SetParent(this); foreach (var item in this.Children) { d.AddChildren(item); } d.Run(); }); stream.OfType <WarningMessage>().Subscribe(x => ReportManage.ErrReport(this, x.Message)); //// stream.OfType<EventMessage>() // .Subscribe(x => Console.WriteLine("{0} by @{1}", x.Event, x.Source.ScreenName)); disposable = stream.Connect(); }
/// <summary> /// このクラスでの実行すること。 /// </summary> /// <param name="runChildren"></param> public override void Run(bool runChildren) { if (string.IsNullOrEmpty(Format)) { ReportManage.ErrReport(this, "Formatが空です"); } else if (Args == null) { ReportManage.ErrReport(this, "Argsが空です"); } else { List <string> list = new List <string>(); foreach (var item in Args) { item.SetParent(this.Parent); item.SetParent(); list.Add(RawlerBase.GetText(GetText(), item, this.Parent)); } SetText(string.Format(Format, list.ToArray())); } base.Run(runChildren); }