How to yield return inside anonymous methods?

后端 未结 7 482
南笙
南笙 2021-01-07 16:43

Basically I have an anonymous method that I use for my BackgroundWorker:

worker.DoWork += ( sender, e ) =>
{
    foreach ( var effect in Glob         


        
7条回答
  •  说谎
    说谎 (楼主)
    2021-01-07 17:09

    The worker should set the Result property of DoWorkEventArgs.

    worker.DoWork += (s, e) => e.Result = GlobalGraph.Effects.Select(x => image.Apply(x));
    

提交回复
热议问题