private static void AddReportEventArgs(RawlerBase sender, ReportEvnetArgs args) { if (sender != null) { var reportStock = sender.GetUpperRawler <ReportStock>(); if (reportStock != null) { reportStock.AddReport(args); return; } } if (args.IsErr) { if (stockErrReport) { reportList.Add(args); } } else { if (stockReport) { reportList.Add(args); } } }
public async Task AddReport(ReportEvnetArgs ea) { if (ea.IsErr && ErrReportTree != null) { await Task.Run(() => RawlerBase.GetText(ea.DateTime.ToFileTimeUtc() + "\t" + ea.Message, ErrReportTree, this)); } if (isStock && ea.IsErr) { reportList.Add(ea); } }
public static void Report(RawlerBase sender, string message, bool returncode) { ReportEvnetArgs args = new ReportEvnetArgs(sender, GetTopComment(sender) + message, returncode); AddReportEventArgs(sender, args); if (message.Contains("NextDataRow")) { RowCount++; } else { ReportEvnet?.Invoke(sender, args); } }
/// <summary> /// Errをレポートする。 /// </summary> /// <param name="sender"></param> /// <param name="err"></param> public static void ErrReport(RawlerBase sender, string err) { ReportEvnetArgs args; if (sender != null) { args = new ReportEvnetArgs(sender, GetTopComment(sender) + "ERR:" + sender.GetType().Name + ":" + err, true, true); } else { args = new ReportEvnetArgs(sender, GetTopComment(sender) + "ERR:" + err, true, true); } AddReportEventArgs(sender, args); ErrReportEvent?.Invoke(sender, args); }
void ReportManage_ReportEvnet(object sender, ReportEvnetArgs e) { this.ReportProgress(0, e); }