public IEnumerable <double> GetResearchValues(IResearchSet researchSet, double inpulseTime, double time) { using (var cs = new CancellationTokenSource()) { _cancellationTokenSource = cs; try { var c = cs; return(researchSet.GetPoints().Select(point => _radiants.Sum(RadiantProcessing(inpulseTime, time, c.Token, point)))); } finally { _cancellationTokenSource = null; } } }
public IEnumerable <Tuple <Point3D, double, IDictionary <ProcessorRadiant, double> > > GetResearchValueByRadinats(IResearchSet researchSet, double inpulseTime, double time) { using (var cs = new CancellationTokenSource()) { _cancellationTokenSource = cs; try { var c = cs; return(researchSet.GetPoints().Select(point => { var dict = _radiants.ToDictionary(it => (ProcessorRadiant)it, RadiantProcessing(inpulseTime, time, c.Token, point)); return new Tuple <Point3D, double, IDictionary <ProcessorRadiant, double> >(point, dict.Values.Sum(), dict); } )); } finally { _cancellationTokenSource = null; } } }