I'm considering making my own PLinq extension method to provide the feature described in my recent question: Specify task timeout in parallel linq to objects. I'd like to reuse as much existing .Net structure as I can, including any code that may already be specifying a Degree of Parallelism on the PLinq query.
In the below code block I'm specifying a degree of parallelism. Assuming that CustomForAll is a custom PLinq extension method with the same signature as the existing ForAll method, how would I read the degree of parallelism specified on the TSource?
private PictureList FetchPictures(List<Picture> wallResults)
{
wallResults
.AsParallel()
.WithDegreeOfParallelism(10)
.CustomForAll(delegate(Picture p){