private ReportAndCancellationToken GetToken(int iterationsCount) { var token = new ReportAndCancellationToken(); var prop = token.GetType().GetProperty("NumberOfIterations", BindingFlags.Instance | BindingFlags.NonPublic); prop.SetValue(token, iterationsCount, null); return(token); }
private bool ShouldReport(ReportAndCancellationToken token, int taken) { return((bool)shouldReportMethod.Invoke(token, new object[] { taken })); }