How to let the code wait to be executed until the other event handler finished?
<p>In the following code, I want to use the <code>geometryService</code> (a utility class provided by third party) to sequentially calculate several shape area. I failed because the second time area calculation mustn't wait until the first calculation is finished. To resolve this issue, I can put the second area calculation into the finish calculation event handler, but the code is a mess. Is there a better way I can make <code>geometryService.AreasAndLengthsAsync(secondShape)</code> wait to execute until<code>geometryService.AreasAndLengthsAsync(firstShape)</code> is finished executing?</p>

<pre><code>Shape firstShape = new Shape();
Shape secondShape = new Shape();

GeometryService geometryService = new GeometryService();
geometryService.AreaAndLengthsCompleted += GeometryService_AreasAndLengthsCompleted;
geometryService.AreasAndLengthsAsync(firstShape);
geometryService.AreasAndLengthsAsync(secondShape);

private void GeometryService_AreasAndLengthsCompleted(object sender, AreasAndLengthsEventArgs args){  }
</code></pre>
