protected virtual void OnJobFinished(object sender, JobProgressEventArgs jobProgressEventArgs) { var handler = JobFinished; if (handler != null) { handler(this, jobProgressEventArgs); } }
protected virtual void OnJobStateChanged(object sender, JobProgressEventArgs jobProgressEventArgs) { var handler = JobStateChanged; if (handler != null) { handler(sender, jobProgressEventArgs); } }
private void Builder_JobProgress(object sender, JobProgressEventArgs e) { if (InvokeRequired) { Invoke(new MethodInvoker(() => Builder_JobProgress(sender, e))); return; } FindHistoryDataGridViewRow(e.Job).Cells[historyJobProgress.Name].Value = $"{e.Progress.ToString("p")} {e.Chapters}장 중 {e.ChaptersDone}장"; }
private static void OnProgressChanged(object sender, JobProgressEventArgs args) { lock (Lines) { if (!Lines.ContainsKey(args.TargetPath)) { Lines.Add(args.TargetPath, Lines.Count); } var text = $"{args.TargetPath} : " + (string.IsNullOrEmpty(args.Error) ? $"{(int) args.Percentage}%" : $"ERROR ({args.Error})"); ConsoleWriteLine(text, Lines[args.TargetPath]); } }
private void Builder_JobProgress(JobProgressEventArgs e) { FindHistoryDataGridViewRow(e.Job).Cells[historyJobProgress.Name].Value = $"{e.Progress:p} {e.Chapters}장 중 {e.ChaptersDone}장"; }